/* =====================================================
   auth.css — Login, forgot password & shop registration
   Kho Hải Sản Marketplace
   ===================================================== */

/* ---- Page shell ---- */
.auth-page {
  background: var(--soft);
  min-height: 80vh;
  padding: 48px 0;
}

/* ---- Two-column layout ---- */
.auth-layout {
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 40px;
  align-items: start;
  max-width: 900px;
  margin: 0 auto;
}

/* Registration page: benefits on the right, form on the left */
.auth-layout--reg {
  grid-template-columns: 1fr 300px;
  max-width: 1100px;
}

/* Narrow variant for forgot-password */
.auth-layout--narrow {
  max-width: 820px;
}

/* ---- Benefits panel (left for login, right sidebar for register) ---- */
.auth-benefits {
  background: linear-gradient(135deg, var(--navy) 0%, #2B7AB9 100%);
  color: #fff;
  border-radius: 20px;
  padding: 36px 32px;
  position: sticky;
  top: 24px;
}

.auth-benefits h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 20px;
  line-height: 1.3;
}

.auth-benefits ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-benefits li {
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.4;
}

.auth-benefits__cta {
  border-top: 1px solid rgba(255, 255, 255, .2);
  margin-top: 28px;
  padding-top: 24px;
}

.auth-benefits__cta p {
  margin-bottom: 12px;
  opacity: .8;
  font-size: 14px;
}

.auth-benefits__cta .btn {
  display: block;
  text-align: center;
}

/* ---- CTA buttons inside dark benefits panel ---- */

/* Primary: orange gradient — most eye-catching */
.auth-benefits__shop-btn {
  display: block;
  width: 100%;
  padding: 13px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #fff !important;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  letter-spacing: .01em;
  box-shadow: 0 4px 18px rgba(249,115,22,.45);
  transition: transform .18s, box-shadow .18s, background .18s;
  border: none;
  margin-bottom: 0;
}

.auth-benefits__shop-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(249,115,22,.55);
  background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
}

/* Secondary: solid white with navy text */
.auth-benefits__reg-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 12px 20px;
  border-radius: 14px;
  background: rgba(255,255,255,.95);
  color: #0c75b8 !important;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  letter-spacing: .01em;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
  transition: transform .18s, box-shadow .18s, background .18s;
  border: none;
}

.auth-benefits__reg-btn:hover {
  transform: translateY(-2px);
  background: #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
}

/* ---- White card form wrapper ---- */
.auth-form-wrap {
  background: #fff;
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: 0 4px 32px rgba(0, 0, 0, .08);
}

/* ---- Form header ---- */
.auth-form-header h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 6px;
  line-height: 1.2;
}

.auth-form-header p {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* ---- Fields ---- */
.auth-field {
  margin-bottom: 18px;
}

.auth-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
}

.auth-field label span[aria-hidden] {
  color: var(--red);
}

.auth-field input,
.auth-field select,
.auth-field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
  box-sizing: border-box;
  color: var(--navy);
  background: #fff;
}

.auth-field input:focus,
.auth-field select:focus,
.auth-field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(43, 122, 185, .12);
}

.auth-field input.has-error,
.auth-field select.has-error {
  border-color: var(--red);
}

/* Inline row (remember + forgot) */
.auth-field--inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.auth-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  color: var(--navy);
}

.auth-checkbox input[type="checkbox"] {
  width: auto;
  margin: 0;
  flex-shrink: 0;
}

.auth-forgot {
  font-size: 13px;
  color: var(--blue);
  text-decoration: none;
}

.auth-forgot:hover {
  text-decoration: underline;
}

/* Password wrapper with toggle */
.auth-field__pw-wrap {
  position: relative;
}

.auth-field__pw-wrap input {
  padding-right: 44px;
}

.auth-pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  font-size: 16px;
  line-height: 1;
  color: var(--muted);
}

/* ---- Submit button ---- */
.auth-submit {
  margin-top: 6px;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
}

/* ---- Notices ---- */
.auth-error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  color: #991B1B;
  margin-bottom: 14px;
  line-height: 1.5;
}

.auth-notice--success {
  background: #F0FDF4;
  border: 1px solid #86EFAC;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  color: #166534;
  margin-bottom: 14px;
  line-height: 1.5;
}

/* ---- Divider ---- */
.auth-divider {
  text-align: center;
  margin: 22px 0;
  position: relative;
}

.auth-divider::before {
  content: '';
  display: block;
  height: 1px;
  background: #E5E7EB;
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
}

.auth-divider span {
  background: #fff;
  padding: 0 12px;
  position: relative;
  color: var(--muted);
  font-size: 13px;
}

/* ---- Alt links ---- */
.auth-alt-links {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.auth-alt-links a {
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
}

.auth-alt-links a:hover {
  text-decoration: underline;
}

.auth-alt-links p {
  margin: 6px 0;
}

/* =====================================================
   Multi-step registration progress indicator
   ===================================================== */

.reg-progress {
  display: flex;
  align-items: flex-start;
  margin-bottom: 32px;
  padding: 0;
  list-style: none;
}

.reg-progress__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}

.reg-progress__step::after {
  content: '';
  position: absolute;
  top: 20px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: #E5E7EB;
  z-index: 0;
  transition: background .3s;
}

.reg-progress__step:last-child::after {
  display: none;
}

.reg-progress__step.completed::after {
  background: #16A34A;
}

.reg-progress__dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #E5E7EB;
  color: var(--muted);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  font-size: 15px;
  transition: background .3s, color .3s, box-shadow .3s;
}

.reg-progress__step.active .reg-progress__dot {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(43, 122, 185, .2);
}

.reg-progress__step.completed .reg-progress__dot {
  background: #16A34A;
  color: #fff;
}

.reg-progress__label {
  font-size: 11px;
  margin-top: 7px;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
}

.reg-progress__step.active .reg-progress__label {
  color: var(--navy);
  font-weight: 700;
}

.reg-progress__step.completed .reg-progress__label {
  color: #16A34A;
}

/* =====================================================
   Step panels
   ===================================================== */

.reg-step {
  display: none;
}

.reg-step.active {
  display: block;
  animation: fadeStepIn .25s ease;
}

@keyframes fadeStepIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.reg-step__title {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid #F1F5F9;
}

/* =====================================================
   Shop type radio cards
   ===================================================== */

.reg-type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 6px;
}

.reg-type-option {
  display: none;
}

.reg-type-option + label {
  border: 2px solid #E5E7EB;
  border-radius: 12px;
  padding: 14px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  text-align: center;
  transition: border-color .2s, background .2s, color .2s;
  line-height: 1.3;
}

.reg-type-option + label:hover {
  border-color: var(--blue);
  background: #f7fbff;
}

.reg-type-option:checked + label {
  border-color: var(--blue);
  background: var(--soft);
  color: var(--blue);
}

.reg-type-icon {
  font-size: 28px;
  display: block;
}

/* =====================================================
   Checkbox grid (product types, delivery zones)
   ===================================================== */

.reg-check-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.reg-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  padding: 9px 12px;
  transition: border-color .2s, background .2s;
  color: var(--navy);
}

.reg-check-label input {
  flex-shrink: 0;
  margin: 0;
  width: auto;
}

.reg-check-label:has(input:checked) {
  border-color: var(--blue);
  background: var(--soft);
}

/* =====================================================
   Navigation buttons
   ===================================================== */

.reg-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #F1F5F9;
  gap: 12px;
}

.reg-nav .btn {
  min-width: 130px;
}

/* =====================================================
   Step 4 — Summary table
   ===================================================== */

.reg-summary {
  background: var(--soft);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 22px;
  border: 1px solid rgba(43, 122, 185, .12);
}

.reg-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 7px 0;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
  font-size: 14px;
  gap: 12px;
}

.reg-summary__row:last-child {
  border-bottom: none;
}

.reg-summary__key {
  color: var(--muted);
  flex-shrink: 0;
  min-width: 110px;
}

.reg-summary__val {
  font-weight: 600;
  color: var(--navy);
  text-align: right;
}

/* =====================================================
   Terms checkboxes (step 4)
   ===================================================== */

.reg-terms-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  margin-bottom: 14px;
  line-height: 1.5;
  color: var(--navy);
}

.reg-terms-wrap input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  width: auto;
}

.reg-terms-wrap a {
  color: var(--blue);
  text-decoration: underline;
}

/* =====================================================
   Success state
   ===================================================== */

.reg-success {
  text-align: center;
  padding: 48px 20px;
}

.reg-success__icon {
  font-size: 72px;
  margin-bottom: 16px;
  display: block;
}

.reg-success h2 {
  font-size: 28px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 12px;
}

.reg-success p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
  max-width: 440px;
  margin: 0 auto 28px;
}

.reg-success .btn {
  margin: 4px;
}

/* =====================================================
   Field-level error message
   ===================================================== */

.field-error {
  color: var(--red);
  font-size: 12px;
  display: block;
  margin-top: 4px;
  min-height: 16px;
}

/* =====================================================
   Responsive
   ===================================================== */

@media (max-width: 900px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-layout--reg {
    grid-template-columns: 1fr;
  }

  /* On mobile: hide the benefits panel for login/forgot; keep it for registration */
  .auth-login-page .auth-benefits,
  .auth-forgot-page .auth-benefits {
    display: none;
  }

  .auth-benefits--sidebar {
    display: block;
  }
}

@media (max-width: 600px) {
  .auth-page {
    padding: 28px 0;
  }

  .auth-form-wrap {
    padding: 24px 18px;
    border-radius: 16px;
  }

  .auth-form-header h1 {
    font-size: 22px;
  }

  .reg-type-grid {
    grid-template-columns: 1fr;
  }

  .reg-check-grid {
    grid-template-columns: 1fr;
  }

  .auth-benefits {
    padding: 28px 20px;
  }

  .reg-progress__label {
    display: none;
  }

  .reg-nav {
    flex-wrap: wrap;
  }

  .reg-nav .btn {
    flex: 1;
    min-width: 0;
  }
}

/* ── Password strength meter ─────────────────────── */
.auth-pw-strength {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-pw-strength__bar {
  flex: 1;
  height: 4px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}
.auth-pw-strength__bar span {
  display: block;
  height: 100%;
  border-radius: 4px;
  transition: width .3s, background .3s;
  width: 0;
}
#reg-pw-label {
  font-size: 12px;
  font-weight: 600;
  min-width: 70px;
  text-align: right;
}
