/* ============================================================
   FINISIT — LOGIN / REGISTER PAGE
   Glass-morphism auth card on obsidian canvas.
   ============================================================ */

/* ---------- Page wrapper ---------- */
.login-page {
  min-height: calc(100vh - var(--nav-height) - var(--ticker-h));
  margin-top: calc(var(--nav-height) + var(--ticker-h));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-8) var(--gutter);
  position: relative;
  overflow: hidden;
}

/* Gold radial glow behind the card */
.login-page::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(ellipse at center,
    rgba(212, 184, 135, 0.12) 0%,
    rgba(212, 184, 135, 0.04) 40%,
    transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Light mode: soften the gold glow and card chrome */
[data-theme="light"] .login-page::before { opacity: 0.15; }
[data-theme="light"] .auth-card {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(196, 154, 60, 0.3);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

/* Secondary deep teal glow */
.login-page::after {
  content: '';
  position: absolute;
  bottom: 10%;
  right: 15%;
  width: 400px;
  height: 400px;
  background: radial-gradient(ellipse at center,
    rgba(31, 73, 89, 0.18) 0%,
    transparent 65%);
  pointer-events: none;
  z-index: 0;
}

/* ---------- Auth card ---------- */
.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: rgba(17, 20, 27, 0.85);
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  padding: 40px;
  box-shadow:
    0 0 0 1px rgba(212, 184, 135, 0.06) inset,
    0 32px 80px rgba(0, 0, 0, 0.65),
    0 0 60px rgba(212, 184, 135, 0.08);
}

/* ---------- Brand header inside card ---------- */
.auth-header {
  text-align: center;
  margin-bottom: var(--sp-6);
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 500;
  letter-spacing: var(--tracking-tight);
  color: var(--ivory);
  margin-bottom: var(--sp-3);
}

.auth-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.auth-tagline {
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--gold);
  font-family: var(--font-mono);
}

/* ---------- Tabs ---------- */
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: var(--sp-6);
  border-bottom: 1px solid var(--border-soft);
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  padding: var(--sp-3) var(--sp-4);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ivory-muted);
  cursor: pointer;
  position: relative;
  transition: color var(--dur-fast) var(--ease-out);
  letter-spacing: 0.02em;
}

.auth-tab::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform var(--dur-base) var(--ease-out);
  border-radius: var(--r-pill);
}

.auth-tab:hover {
  color: var(--ivory-soft);
}

.auth-tab.is-active {
  color: var(--gold);
}

.auth-tab.is-active::after {
  transform: scaleX(1);
}

/* ---------- Forms ---------- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-form[hidden] {
  display: none;
}

/* ---------- Form group (label + input) ---------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--ivory-muted);
  font-family: var(--font-mono);
}

.form-label .optional-tag {
  font-weight: 400;
  color: var(--ivory-dim);
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  margin-left: var(--sp-2);
}

/* ---------- Input ---------- */
.form-input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-soft);
  color: var(--ivory);
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: var(--text-base);
  font-family: var(--font-body);
  width: 100%;
  box-sizing: border-box;
  transition:
    border-color var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
  outline: none;
  -webkit-appearance: none;
}

.form-input::placeholder {
  color: var(--ivory-dim);
}

.form-input:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(212, 184, 135, 0.18);
}

.form-input:focus {
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(212, 184, 135, 0.10);
}

.form-input.is-error {
  border-color: #F26B6B;
  box-shadow: 0 0 0 3px rgba(242, 107, 107, 0.10);
}

.form-input.is-success {
  border-color: #5FD4A4;
  box-shadow: 0 0 0 3px rgba(95, 212, 164, 0.10);
}

/* Password wrapper (for toggle visibility) */
.form-input-wrap {
  position: relative;
}

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

.form-input-wrap .pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ivory-dim);
  padding: 4px;
  transition: color var(--dur-fast) var(--ease-out);
  line-height: 1;
}

.form-input-wrap .pw-toggle:hover {
  color: var(--gold);
}

/* ---------- Error message ---------- */
.form-error {
  font-size: var(--text-xs);
  color: #F26B6B;
  margin-top: -10px;
  display: none;
}

.form-error.is-visible {
  display: block;
}

/* ---------- Password strength meter ---------- */
.pw-strength {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.pw-strength__bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}
.pw-strength__fill {
  display: block;
  height: 100%;
  width: 0%;
  background: #888;
  transition: width 0.18s ease, background 0.18s ease;
}
.pw-strength__label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ivory-dim);
  letter-spacing: 0.04em;
  text-transform: lowercase;
  white-space: nowrap;
}

/* ---------- Hint text below form fields ---------- */
.form-hint {
  font-size: var(--text-xs);
  color: var(--ivory-dim);
  margin-top: var(--sp-1);
  line-height: 1.4;
}

/* ---------- Row: remember me + forgot password ---------- */
.form-row-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

/* ---------- Checkbox ---------- */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  cursor: pointer;
  user-select: none;
}

.form-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition:
    background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}

.form-check input[type="checkbox"]:checked {
  background: var(--gold);
  border-color: var(--gold);
}

.form-check input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 2px;
  width: 6px;
  height: 9px;
  border: 2px solid #0B0D12;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.form-check input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.form-check-label {
  font-size: var(--text-sm);
  color: var(--ivory-muted);
  line-height: 1.4;
}

.form-check-label a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-check-label a:hover {
  color: var(--gold-light);
}

/* Forgot password link */
.auth-link {
  font-size: var(--text-sm);
  color: var(--ivory-dim);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}

.auth-link:hover {
  color: var(--gold);
}

/* ---------- Primary CTA button ---------- */
.auth-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  width: 100%;
  padding: 14px 24px;
  background: var(--grad-gold);
  border: none;
  border-radius: var(--r-md);
  color: var(--ink-obsidian);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    opacity var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
  box-shadow: 0 4px 20px rgba(212, 184, 135, 0.25);
}

.auth-btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.auth-btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(212, 184, 135, 0.38);
}

.auth-btn-primary:hover::before {
  opacity: 1;
}

.auth-btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 12px rgba(212, 184, 135, 0.22);
}

.auth-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Loading spinner inside button */
.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(11, 13, 18, 0.25);
  border-top-color: var(--ink-obsidian);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

.auth-btn-primary.is-loading .btn-spinner {
  display: block;
}

.auth-btn-primary.is-loading .btn-label {
  opacity: 0.6;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Divider ---------- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--ivory-dim);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: lowercase;
  font-family: var(--font-body);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-soft);
}

/* ---------- Social auth buttons ---------- */
.social-btns {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  width: 100%;
  padding: 11px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  color: var(--ivory-soft);
  font-size: var(--text-sm);
  font-weight: 400;
  font-family: var(--font-body);
  cursor: pointer;
  transition:
    background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
  text-decoration: none;
}

.social-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(212, 184, 135, 0.22);
  color: var(--ivory);
  transform: translateY(-1px);
}

.social-btn:active {
  transform: translateY(0);
}

.social-btn svg,
.social-btn img {
  flex-shrink: 0;
}

/* ---------- Switch tab prompt (below card) ---------- */
.auth-switch {
  margin-top: var(--sp-5);
  font-size: var(--text-sm);
  color: var(--ivory-muted);
  text-align: center;
  position: relative;
  z-index: 1;
}

.auth-switch a {
  color: var(--gold);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

.auth-switch a:hover {
  color: var(--gold-light);
}

/* ---------- Tier preview strip ---------- */
.tier-strip {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 860px;
  margin-top: var(--sp-8);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
}

.tier-card {
  background: rgba(17, 20, 27, 0.6);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-4);
  text-align: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition:
    border-color var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out);
}

.tier-card:hover {
  transform: translateY(-3px);
}

/* Tier accent colours */
.tier-card--wave   { border-color: rgba(95, 212, 232, 0.20); }
.tier-card--wave:hover { border-color: rgba(95, 212, 232, 0.45); box-shadow: 0 8px 24px rgba(95,212,232,0.10); }
.tier-card--dolphin { border-color: rgba(183, 148, 246, 0.20); }
.tier-card--dolphin:hover { border-color: rgba(183, 148, 246, 0.45); box-shadow: 0 8px 24px rgba(183,148,246,0.10); }
.tier-card--shark  { border-color: rgba(212, 184, 135, 0.20); }
.tier-card--shark:hover  { border-color: rgba(212, 184, 135, 0.45); box-shadow: 0 8px 24px rgba(212,184,135,0.10); }
.tier-card--apex   { border-color: rgba(245, 164, 208, 0.20); }
.tier-card--apex:hover   { border-color: rgba(245, 164, 208, 0.45); box-shadow: 0 8px 24px rgba(245,164,208,0.12); }

.tier-icon {
  font-size: 1.5rem;
  margin-bottom: var(--sp-2);
  line-height: 1;
}

.tier-name {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  margin-bottom: var(--sp-2);
}

.tier-card--wave   .tier-name { color: var(--shark-glow); }
.tier-card--dolphin .tier-name { color: var(--tier-epic); }
.tier-card--shark  .tier-name { color: var(--gold); }
.tier-card--apex   .tier-name { color: var(--tier-mythic); }

.tier-benefit {
  font-size: var(--text-xs);
  color: var(--ivory-muted);
  line-height: var(--leading-normal);
}

.tier-strip-label {
  position: relative;
  z-index: 1;
  text-align: center;
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--ivory-dim);
  font-family: var(--font-mono);
  margin-top: var(--sp-7);
  margin-bottom: var(--sp-3);
}

/* ---------- Toast notification ---------- */
.auth-toast {
  position: fixed;
  bottom: var(--sp-6);
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--ink-charcoal);
  border: 1px solid var(--border-gold);
  border-radius: var(--r-pill);
  padding: var(--sp-3) var(--sp-5);
  font-size: var(--text-sm);
  color: var(--ivory);
  z-index: 200;
  opacity: 0;
  transition:
    transform var(--dur-base) var(--ease-luxe),
    opacity var(--dur-base) var(--ease-luxe);
  pointer-events: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.auth-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.auth-toast--success { border-color: rgba(95, 212, 164, 0.4); }
.auth-toast--error   { border-color: rgba(242, 107, 107, 0.4); }

/* ---------- Light mode overrides ---------- */
[data-theme="light"] .auth-card {
  background: rgba(249, 245, 238, 0.88);
  border-color: var(--border-gold);
  box-shadow:
    0 0 0 1px rgba(139, 111, 63, 0.08) inset,
    0 32px 80px rgba(60, 40, 10, 0.14),
    0 0 60px rgba(139, 111, 63, 0.10);
}

[data-theme="light"] .form-input {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(139, 111, 63, 0.18);
  color: var(--text);
}

[data-theme="light"] .form-input:focus {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--gold-deep);
  box-shadow: 0 0 0 3px rgba(139, 111, 63, 0.12);
}

[data-theme="light"] .form-input::placeholder {
  color: var(--ivory-dim);
}

[data-theme="light"] .social-btn {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(139, 111, 63, 0.18);
  color: var(--text-muted);
}

[data-theme="light"] .social-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(139, 111, 63, 0.38);
  color: var(--text);
}

[data-theme="light"] .tier-card {
  background: rgba(237, 230, 216, 0.7);
}

[data-theme="light"] .login-page::before {
  background: radial-gradient(ellipse at center,
    rgba(139, 111, 63, 0.12) 0%,
    rgba(139, 111, 63, 0.04) 40%,
    transparent 70%);
}

[data-theme="light"] .auth-divider::before,
[data-theme="light"] .auth-divider::after {
  background: var(--border-soft);
}

/* ---------- Mobile responsive ---------- */
@media (max-width: 600px) {
  .auth-card {
    padding: 28px 20px;
    border-radius: 16px;
    max-width: 100%;
  }

  .tier-strip {
    grid-template-columns: repeat(2, 1fr);
    max-width: 100%;
  }

  .login-page {
    padding: var(--sp-6) var(--sp-4);
    justify-content: flex-start;
  }

  .auth-btn-primary {
    padding: 13px 20px;
  }
}

@media (max-width: 380px) {
  .tier-strip {
    grid-template-columns: 1fr;
  }
}
