/* ===== Auth pages (login / register / otp) ===== */
.auth-body {
  background: var(--beige);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-wrap {
  width: 100%;
  max-width: 440px;
}

.auth-card {
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 32px 28px;
}
.auth-card-orange { border: 2px solid var(--orange); }

.auth-head {
  text-align: center;
  margin-bottom: 24px;
}
.auth-logo {
  flex-direction: column;
  justify-content: center;
  gap: 0;
  margin-bottom: 0;
}
.auth-logo .logo-icon { width: 160px; height: auto; }
.auth-logo .logo-icon img { width: 100%; height: auto; }
.auth-head h1 { font-size: 1.4rem; margin-bottom: 6px; }
.auth-head p { color: var(--text-muted); font-size: 0.88rem; }

.step-indicator {
  color: var(--orange-dark);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.step { display: none; }
.step.active { display: block; }

.step-circles {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  margin: 20px 0 28px;
  padding-bottom: 20px; /* room for the labels, which sit below the circles */
}
/* Each step is exactly as wide as its circle. The label is positioned under it
   and can spill wider on both sides, so a long label like "Enter email" can't
   push the connecting bars away from the circles. */
.step-item {
  position: relative;
  width: 40px;
}
.step-circles .circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e2ddd7;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.05rem;
  transition: background 0.2s;
}
.step-circles .circle.active,
.step-circles .circle.done {
  background: var(--orange);
}
.step-label {
  position: absolute;
  top: 46px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.step-circles .bar {
  width: 56px;
  height: 2px;
  background: #e2ddd7;
  margin-top: 19px;
  transition: background 0.2s;
}
.step-circles .bar.done {
  background: var(--orange);
}

.step-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 16px;
}
.step-hint-center { text-align: center; }

.link-btn {
  display: block;
  text-align: center;
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
}
.link-btn:hover { color: var(--orange); }

.required { color: #e0483e; }

.password-field { position: relative; }
.password-field input { padding-right: 44px; }
.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.95rem;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 18px;
  font-size: 0.85rem;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dark);
}
.checkbox-label input { accent-color: var(--orange); width: 16px; height: 16px; }
.forgot-link { color: var(--orange); font-weight: 600; }

/* Size, spacing and colours: css/shared/style.css */
.auth-status { text-align: center; }

/* A message about the code sits centred under the row of code boxes, which turn red */
.otp-boxes.field-invalid .otp-box { border-color: #d94b3b; }
.otp-group .field-error,
.otp-group .field-success { text-align: center; }

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.auth-switch a { color: var(--orange); font-weight: 600; }

.password-hints {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.password-hints li { display: flex; align-items: center; gap: 6px; }
.password-hints li i { font-size: 0.7rem; color: #c8bcae; }
.password-hints li.valid { color: #1f9254; }
.password-hints li.valid i { color: #1f9254; }
.password-hints li.invalid { color: #d94b3b; }
.password-hints li.invalid i { color: #d94b3b; }

/* New password step: two-column checklist (forgot-password only) */
.pw-checklist {
  list-style: none;
  margin: 0 0 16px;
  padding: 10px 12px;
  background: #fbf8f5;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(3, auto);
  grid-auto-flow: column;
  gap: 6px 12px;
  font-size: 0.74rem;
  color: var(--text-muted);
}
.pw-checklist li { display: flex; align-items: center; gap: 6px; }
.pw-checklist li i { font-size: 0.8rem; color: #c8bcae; }
.pw-checklist li.valid, .pw-checklist li.valid i { color: #1f9254; }
.pw-checklist li.invalid, .pw-checklist li.invalid i { color: #d94b3b; }

.reset-email {
  color: var(--orange);
  font-weight: 700;
}

.otp-timer {
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-dark);
  margin: 14px 0;
}

/* The group is only as wide as the six boxes and is centred on the card, with the
   label centred above the row. */
.otp-group { width: max-content; max-width: 100%; margin: 0 auto; }
.otp-group label { text-align: center; }
.otp-boxes {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
}
.otp-group input.otp-box {
  width: 42px;
  height: 48px;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  padding: 0;
  /* Override .otp-inputs letter-spacing: it adds space after the single digit
     and pushes it off-centre in the box. */
  letter-spacing: 0;
}

.otp-inputs input {
  text-align: center;
  letter-spacing: 10px;
  font-size: 1.4rem;
  font-weight: 700;
}

.auth-resend {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--orange);
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
}
.auth-resend:disabled { color: var(--text-muted); cursor: not-allowed; }

.field-note { font-size: 0.74rem; color: var(--text-muted); margin-top: 5px; }
.caps-lock-warning {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #9a6b00;
}
.caps-lock-warning[hidden] { display: none; }

/* ===== Login spacing =====
   Used by the login and forgot-password pages (body.auth-tight). The register
   and OTP pages keep their current spacing. */
.auth-tight.auth-body { padding: 24px 16px; }
.auth-tight .step-circles { margin: 14px 0 18px; }
.auth-tight .auth-wrap { max-width: 420px; }
/* Top is 20px because the logo PNG has about 6px of blank space above the
   shield at this size, so the visible top gap matches the 26px bottom gap. */
.auth-tight .auth-card { padding: 20px 26px 26px; }
.auth-tight .auth-logo .logo-icon { width: 120px; }
.auth-tight .auth-head { margin-bottom: 18px; }
.auth-tight .form-group { margin-bottom: 14px; }
.auth-tight .auth-row { margin: 2px 0 14px; }
.auth-tight .auth-status { margin-top: 10px; min-height: 0; }
.auth-tight .auth-status:empty { display: none; }

@media (max-width: 520px) {
  .auth-tight .auth-card { padding: 16px 20px 22px; }
}

/* Sign-in lockout: how long to wait, under the Sign in button */
.login-countdown {
  margin: 8px 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.login-countdown[hidden] { display: none; }
