:root {
  --teal: #0d6e7a;
  --teal-light: #14b8a6;
  --teal-dark: #0a5560;
  --cyan: #22d3ee;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
  --bg: #030712;
  --bg-card: rgba(15, 23, 42, 0.78);
  --text: #f8fafc;
  --muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.18);
  --glow: rgba(20, 184, 166, 0.35);
  --input-bg: rgba(15, 23, 42, 0.65);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.auth-page {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

.auth-page a { color: var(--teal-light); text-decoration: none; font-weight: 600; }
.auth-page a:hover { color: #2dd4bf; }

.auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 20% 0%, rgba(13, 110, 122, 0.4), transparent),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(59, 130, 246, 0.15), transparent);
}

.auth-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 30% 40%, black, transparent);
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.45;
  animation: authFloatOrb 20s ease-in-out infinite;
}

.auth-orb-1 { width: 380px; height: 380px; background: var(--teal); top: -10%; left: -8%; }
.auth-orb-2 { width: 300px; height: 300px; background: #3b82f6; bottom: 5%; right: -5%; animation-delay: -8s; }
.auth-orb-3 { width: 220px; height: 220px; background: var(--green); top: 40%; left: 35%; animation-delay: -14s; opacity: 0.25; }

@keyframes authFloatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(24px, -18px) scale(1.04); }
  66% { transform: translate(-16px, 20px) scale(0.96); }
}

.auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

.auth-brand {
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  position: relative;
}

.auth-brand-intro {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.brand-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
  text-decoration: none;
  animation: authFadeUp 0.7s ease both;
}

.brand-top:hover { color: #fff; }

.brand-copy {
  max-width: 460px;
  animation: authFadeUp 0.7s ease 0.1s both;
}

.brand-copy h1 {
  margin: 0 0 12px;
  font-size: clamp(1.9rem, 3.2vw, 2.5rem);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-copy p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 1rem;
}

.auth-brand-aside-card {
  animation: authFadeUp 0.8s ease 0.25s both;
}

.brand-visual,
.auth-brand .pricing-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  transform-style: preserve-3d;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.brand-visual:hover,
.auth-brand .pricing-card:hover {
  box-shadow: 0 28px 70px rgba(20, 184, 166, 0.12);
}

.auth-brand .pricing-card {
  margin: 0;
}

.auth-brand .pricing-card::before {
  display: none;
}

.auth-brand .pricing-card--compact {
  padding: 16px;
}

.auth-brand .pricing-badge { margin-bottom: 10px; }
.auth-brand .pricing-price { margin-bottom: 12px; }
.auth-brand .pricing-features { margin-bottom: 14px; gap: 6px; }
.auth-brand .pricing-features li { font-size: 0.82rem; }
.auth-brand .pricing-upi { margin-bottom: 10px; padding: 12px; }
.auth-brand .pricing-card--compact .pricing-upi img { width: 88px; height: 88px; }
.auth-brand .pricing-note,
.auth-brand .support-contact-note { font-size: 0.74rem; }
.auth-brand .support-contact { padding-top: 10px; }

.brand-visual-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.brand-visual-badges {
  display: flex;
  gap: 6px;
}

.brand-badge {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
}

.brand-badge.expiry { background: rgba(34, 197, 94, 0.15); color: #86efac; }
.brand-badge.today { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }

#authBrandChart {
  display: block;
  width: 100%;
  height: 140px;
  border-radius: 10px;
}

.brand-points {
  display: grid;
  gap: 8px;
  animation: authFadeUp 0.8s ease 0.2s both;
}

.brand-point {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: #cbd5e1;
}

.brand-point span {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(20, 184, 166, 0.15);
  border: 1px solid rgba(20, 184, 166, 0.3);
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  color: var(--teal-light);
}

.auth-panel-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 32px 32px 16px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 32px;
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  animation: authFadeUp 0.75s ease 0.15s both;
  transform-style: preserve-3d;
  transition: box-shadow 0.25s ease;
}

.auth-card.shake { animation: authShake 0.45s ease; }

@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

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

.auth-card h2 {
  margin: 0 0 6px;
  font-size: 1.65rem;
  font-weight: 800;
}

.auth-card .subtitle {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 0.94rem;
}

.back-home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.back-home:hover { color: var(--teal-light); }

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.field-hint {
  display: block;
  margin-top: 5px;
  font-size: 0.78rem;
  color: var(--muted);
}

.field-hint.ok { color: #86efac; }
.field-hint.bad { color: #fca5a5; }

.input-wrap { position: relative; }

.input-wrap input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.96rem;
  background: var(--input-bg);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.input-wrap input::placeholder { color: #64748b; }

.input-wrap.has-toggle input { padding-right: 48px; }

.input-wrap input:focus {
  outline: none;
  border-color: rgba(20, 184, 166, 0.6);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
  background: rgba(15, 23, 42, 0.9);
}

.input-wrap input.invalid {
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.input-wrap input.valid { border-color: rgba(34, 197, 94, 0.55); }

.toggle-pw {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  border-radius: 8px;
  line-height: 0;
  z-index: 2;
}

.toggle-pw svg { width: 20px; height: 20px; pointer-events: none; }
.toggle-pw .pw-icon-hide { display: none; }
.toggle-pw.is-visible .pw-icon-show { display: none; }
.toggle-pw.is-visible .pw-icon-hide { display: block; }
.toggle-pw:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }

.pw-meter {
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  margin-top: 8px;
  overflow: hidden;
}

.pw-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  transition: width 0.25s ease, background 0.25s ease;
  background: var(--red);
}

.captcha-wrap { margin: 4px 0 16px; min-height: 78px; }
.captcha-wrap .g-recaptcha { transform-origin: left top; }

@media (max-width: 400px) {
  .captcha-wrap .g-recaptcha { transform: scale(0.92); }
}

.alert {
  display: none;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.4;
}

.alert.error {
  display: block;
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.alert.success {
  display: block;
  background: rgba(20, 184, 166, 0.12);
  color: #5eead4;
  border: 1px solid rgba(20, 184, 166, 0.25);
}

.submit-btn {
  width: 100%;
  margin-top: 8px;
  padding: 13px 18px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--teal-light), var(--teal));
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 6px 24px var(--glow);
}

.submit-btn:hover:not(:disabled) {
  box-shadow: 0 10px 32px rgba(20, 184, 166, 0.45);
  transform: translateY(-1px);
}

.submit-btn:active:not(:disabled) { transform: scale(0.98); }
.submit-btn:disabled { opacity: 0.65; cursor: not-allowed; }

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: authSpin 0.7s linear infinite;
  display: none;
}

.submit-btn.loading .spinner { display: block; }

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

.switch-link {
  margin-top: 20px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.master-note {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
}

@media (max-width: 960px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand {
    padding: 28px 24px 8px;
    gap: 20px;
  }
  .auth-panel-wrap { padding: 16px 16px 40px; }
  #authBrandChart { height: 110px; }
}

@media (max-width: 480px) {
  .auth-card { padding: 24px 18px; }
  .auth-brand { padding: 24px 16px 4px; }
  .auth-brand .pricing-card--compact .pricing-upi {
    flex-direction: row;
    align-items: center;
  }
  .auth-brand .pricing-upi-meta { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-orb,
  .brand-top,
  .brand-copy,
  .brand-points,
  .auth-brand-aside-card,
  .auth-card {
    animation: none !important;
  }
}
