/* components.css — auth card, fields, buttons, strength meter, icon bubbles */

/* ─── Auth card ────────────────────────────────────────────── */
.auth-card {
  background: rgba(17, 36, 54, 0.82);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 32px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.auth-card h1 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
}

.auth-card h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
}

.auth-card p {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0 0 8px;
  line-height: 1.55;
}

.auth-card p.text-dim {
  font-size: 12px;
  color: var(--text-muted);
}

.auth-card .text-warm { color: var(--tan); font-weight: 500; }

.auth-card .card-subtitle {
  font-size: 12px;
  color: var(--text-dim);
  margin: 0 0 24px;
}

/* Centred success/error layouts inside a card */
.auth-card.is-centred {
  text-align: center;
}
.auth-card.is-centred h2 { margin-top: 0; }
.auth-card.is-centred .icon-bubble { margin: 0 auto 18px; }

/* ─── Icon bubble (for success/error cards) ──────────────────── */
.icon-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(var(--teal-rgb), 0.12);
  border: 1px solid rgba(var(--teal-rgb), 0.30);
}
.icon-bubble .icon { width: 24px; height: 24px; }
.icon-bubble.icon-bubble-teal    .icon { color: var(--teal); }
.icon-bubble.icon-bubble-danger  { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.30); }
.icon-bubble.icon-bubble-danger  .icon { color: var(--danger); }
.icon-bubble.icon-bubble-warning { background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.30); }
.icon-bubble.icon-bubble-warning .icon { color: var(--warning); }

/* ─── Form fields ────────────────────────────────────────────── */
.field {
  margin-bottom: 14px;
}

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.field-input-wrap {
  position: relative;
  display: block;
}

.field-input-wrap .icon-leading {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.auth-input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-input);
  font-size: 14px;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
  /* When a leading icon is present, padding-left increases */
}
.auth-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(var(--teal-rgb), 0.12);
}
.auth-input::placeholder { color: var(--text-muted); }

.field-input-wrap.has-icon-leading .auth-input { padding-left: 36px; }
.field-input-wrap.has-icon-trailing .auth-input { padding-right: 40px; }

.field-input-wrap select.auth-input { appearance: none; }

.field-help {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

.field-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 6px;
}

/* Password show/hide eye toggle */
.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  transition: color 150ms ease;
}
.password-toggle:hover { color: var(--text-dim); }
.password-toggle .icon { width: 15px; height: 15px; }
.password-toggle .icon-eye-off { display: none; }
.password-toggle[aria-pressed="true"] .icon-eye     { display: none; }
.password-toggle[aria-pressed="true"] .icon-eye-off { display: inline; }

/* Label row used on login: "Password" + "Forgot password?" */
.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.label-row label { font-size: 12px; font-weight: 500; color: var(--text-dim); margin: 0; }
.label-row a { font-size: 12px; color: var(--teal); }

/* ─── Buttons ───────────────────────────────────────────────── */
.auth-btn-primary,
.auth-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-input);
  font-size: 14px;
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: opacity 150ms ease, background 150ms ease, color 150ms ease;
}

.auth-btn-primary {
  background: var(--teal);
  color: #07101f;
}
.auth-btn-primary:hover  { opacity: 0.9; }
.auth-btn-primary:active { opacity: 0.85; }
.auth-btn-primary:disabled,
.auth-btn-primary[aria-disabled="true"] { opacity: 0.6; cursor: not-allowed; }

.auth-btn-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text-dim);
}
.auth-btn-secondary:hover { border-color: var(--teal); color: var(--text); }

.auth-btn-primary .icon,
.auth-btn-secondary .icon { width: 15px; height: 15px; }

.button-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
/* Override the base 100% width so the buttons can sit side-by-side
   inside the flex row instead of each trying to fill the full width. */
.button-row .auth-btn-primary,
.button-row .auth-btn-secondary { width: auto; }
.button-row .auth-btn-primary   { flex: 1; }
.button-row .auth-btn-secondary { flex: 0 0 auto; padding-left: 16px; padding-right: 16px; }

/* Submit spinner — initially hidden, shown by JS */
.auth-btn-primary .spinner,
.auth-btn-secondary .spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spinner-rotate 0.8s linear infinite;
}
.auth-btn-primary.is-loading .spinner,
.auth-btn-secondary.is-loading .spinner { display: inline-block; }
.auth-btn-primary.is-loading .btn-label,
.auth-btn-secondary.is-loading .btn-label,
.auth-btn-primary.is-loading .icon,
.auth-btn-secondary.is-loading .icon { display: none; }

/* ─── Non-field error pill ──────────────────────────────────── */
.form-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(248, 113, 113, 0.10);
  border: 1px solid rgba(248, 113, 113, 0.30);
  color: var(--danger);
  font-size: 12px;
}

/* ─── Strength meter ────────────────────────────────────────── */
.strength-meter {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  align-items: center;
}
.strength-meter .seg {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: var(--border);
  transition: background 150ms ease;
}
.strength-meter[data-level="1"] .seg:nth-child(-n+1) { background: var(--danger); }
.strength-meter[data-level="2"] .seg:nth-child(-n+2) { background: var(--warning); }
.strength-meter[data-level="3"] .seg:nth-child(-n+3) { background: var(--teal); }
.strength-meter[data-level="4"] .seg                  { background: var(--teal); }
.strength-meter .seg.is-empty { background: var(--border); }
.strength-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 8px;
  min-width: 56px;
  text-align: right;
}

/* ─── Signup step indicator ─────────────────────────────────── */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
}
.step-indicator .step-dot {
  width: 16px;
  height: 3px;
  border-radius: 999px;
  background: var(--border);
  transition: background 150ms ease;
}
.step-indicator .step-dot.is-active { background: var(--teal); }
.step-indicator .step-label {
  margin-left: 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
}

/* Hide non-active step via aria-hidden */
[data-step][aria-hidden="true"] { display: none; }

/* ─── Icons (sprite uses <svg><use /></svg>) ────────────────── */
.icon {
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ─── Centred page wrapper for in-app auth screens ──────────── */
.page-centred {
  display: flex;
  justify-content: center;
  padding: 48px 16px;
}
.page-centred .auth-card { width: 100%; max-width: 480px; }
