@import url('/design-tokens.css');
/* c2bspan auth design language: white surface, hairline borders, one navy accent.
   Shared by retailer pages (classes .auth-*) and user pages (.brand-*, .form-input, .btn-submit).
   Light theme only: body.dark resolves to the same tokens. */
:root, body, body.dark {
  color-scheme: light;
  --bg: #FFFFFF; --surface: #FFFFFF; --surface-soft: #F7F8FA; --surface-muted: #F0F2F5;
  --ink: #111827; --ink-soft: #374151; --muted: #6B7280; --muted-2: #6B7280;
  --line: #ECEEF1; --border: #ECEEF1;
  --accent: #0B5FA5; --accent-strong: #0B5FA5; --accent-soft: #EEF4FA; --accent-hover: #094E88;
  --navy: #0B5FA5; --navy-2: #0B5FA5;
  --success: #15803D; --success-soft: #F0FDF4;
  --warning: #B45309; --warning-soft: #FFFBEB;
  --danger: #DC2626; --danger-soft: #FEF2F2;
  --shadow: 0 1px 2px rgba(17,24,39,.04), 0 4px 16px rgba(17,24,39,.05);
  --radius-card: 16px; --radius-control: 12px;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { overflow-x: hidden; }
html body, html body button, html body input, html body select, html body textarea {
  font-family: var(--font-sans);
}
html body {
  margin: 0; min-height: 100vh; width: 100%;
  background: #FFFFFF; color: var(--ink);
  font-size: 14px; line-height: 1.5;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 16px;
}
:focus-visible { outline: 2px solid #0B5FA5; outline-offset: 2px; }

/* Layout */
.auth-container, .auth-wrapper { width: 100%; max-width: 440px; margin: 0 auto; }
.auth-nav-top, .auth-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; width: 100%; }
/* Theme is light only; the toggle stays in the DOM so its script keeps working. */
#themeToggle, .theme-toggle-btn { display: none !important; }

html :is(body, body.dark) .auth-card {
  background: #FFFFFF; border: 1px solid var(--line); border-radius: 16px;
  padding: 32px 28px 28px; box-shadow: var(--shadow);
  width: 100%; max-width: 440px; margin-inline: auto;
}
/* Pages that widen their card (register) keep that width */
html :is(body, body.dark) .auth-card.wide, html :is(body, body.dark) .auth-card[data-wide] { max-width: none; }

/* Brand lockup */
.auth-brand, .brand-header .auth-lockup { display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.auth-logo-wrap, .auth-lockup { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.auth-logo-img, .auth-lockup img { height: 64px; width: 64px; max-width: none; display: block; }
.auth-wordmark { font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); line-height: 1; }
.auth-wordmark b { font-weight: 800; color: var(--accent); }

/* Eyebrow chip (pseudo-element so page markup and JS-updated headings stay untouched) */
.auth-header h1::before, .brand-title::before {
  content: "RELIGARE NSDL PAAM";
  display: table; margin: 0 auto 12px;
  padding: 5px 10px 5px 26px; border-radius: 999px;
  border: 1px solid var(--line); background: #FFFFFF;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B5FA5' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10Z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 9px center; background-size: 12px;
  color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .12em; line-height: 1.2;
}
.auth-header, .brand-header { text-align: center; margin-bottom: 24px; }
.auth-header h1, .brand-title { margin: 0 0 6px; font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); line-height: 1.25; }
.auth-header p, .brand-subtitle { margin: 0; color: var(--muted); font-size: 14px; }

/* Trust line under the card */
.auth-container::after, .auth-wrapper::after {
  content: "Authorized Religare NSDL Service Provider";
  display: block; margin-top: 20px; text-align: center; color: var(--muted); font-size: 12px;
}

/* Back / ghost buttons */
.btn-ghost, .btn-back {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: #FFFFFF; color: var(--ink-soft); font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none;
  box-shadow: none; transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn-ghost:hover, .btn-back:hover { background: var(--surface-soft); border-color: #D9DEE5; color: var(--ink); }
.btn-ghost:disabled { opacity: .55; cursor: not-allowed; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label, .form-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.input-wrap { position: relative; display: flex; align-items: center; }
html body input[type="text"], html body input[type="email"], html body input[type="password"],
html body input[type="tel"], html body input[type="number"], html body select, html body .form-input {
  width: 100%; min-width: 0; height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 12px; background: #FFFFFF; color: var(--ink);
  font-size: 14px; outline: 0;
  transition: border-color .15s ease, box-shadow .15s ease;
}
html body input::placeholder { color: #9CA3AF; }
html body input:hover:not(:disabled), html body select:hover { border-color: #D9DEE5; }
html body input:focus, html body select:focus, html body textarea:focus, html body .form-input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(11,95,165,.12); outline: 0;
}
html body input:disabled { background: var(--surface-soft); color: var(--muted); }

.password-field-wrap { position: relative; display: flex; align-items: center; width: 100%; }
.password-field-wrap input { width: 100%; padding-right: 44px !important; }
.password-toggle-btn, .btn-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; cursor: pointer; padding: 8px; display: flex; align-items: center; justify-content: center;
  color: var(--muted); border-radius: 8px; transition: color .15s ease; z-index: 2;
}
.password-toggle-btn:hover, .btn-eye:hover { color: var(--ink); }
.password-toggle-btn svg { width: 16px; height: 16px; display: block; }

/* Primary button */
html :is(body, body.dark) .btn-primary, html :is(body, body.dark) .btn-submit {
  width: 100%; height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 16px; border: 1px solid var(--accent); border-radius: 12px; background: var(--accent); color: #FFFFFF;
  font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
}
html :is(body, body.dark) .btn-primary:hover:not(:disabled), html :is(body, body.dark) .btn-submit:hover:not(:disabled) {
  background: var(--accent-hover); border-color: var(--accent-hover);
}
html :is(body, body.dark) .btn-primary:hover .icon-arrow { transform: translateX(3px); }
.btn-primary:active, .btn-submit:active { transform: translateY(1px); }
.btn-primary:disabled, .btn-submit:disabled { opacity: .55; cursor: not-allowed; }
.icon-arrow { width: 14px; height: 14px; display: inline-block; vertical-align: middle; transition: transform .15s ease; }

/* Links */
.auth-links { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; text-align: center; font-size: 13px; }
.auth-links a, .auth-footer a { color: var(--accent); font-weight: 600; text-decoration: none; }
.auth-links a:hover, .auth-footer a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
.auth-footer { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 13px; }
html :is(body, body.dark) .alt-link-btn { color: var(--accent); font-size: 13px; font-weight: 600; border-radius: 8px; }
html :is(body, body.dark) .alt-link-btn:hover { color: var(--accent-hover); }
.alt-auth-links { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); text-align: center; }

/* Feedback (status colours only) */
.form-error, .form-success, .feedback-msg {
  padding: 10px 14px; border-radius: 12px; margin-bottom: 16px; font-size: 13px; line-height: 1.45; display: none;
}
.form-error, .feedback-msg { background: var(--danger-soft); color: #B91C1C; border: 1px solid #FECACA; }
.form-success { background: var(--success-soft); color: var(--success); border: 1px solid #BBF7D0; }
.form-error.show, .form-success.show { display: block; }

.badge-bonus {
  display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); color: var(--accent);
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; margin-bottom: 12px;
}

/* Channel tabs (pills) */
html :is(body, body.dark) .channel-nav {
  display: flex; gap: 4px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin-bottom: 20px;
}
html :is(body, body.dark) .channel-pill {
  flex: 1; min-height: 36px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); background: transparent;
}
html :is(body, body.dark) .channel-pill:hover:not(.active) { color: var(--ink); }
html :is(body, body.dark) .channel-pill.active { background: var(--accent); color: #FFFFFF; box-shadow: none; }

/* Phone field */
html :is(body, body.dark) .phone-input-wrap {
  display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: #FFFFFF; overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}
html :is(body, body.dark) .phone-input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(11,95,165,.12); }
html :is(body, body.dark) .phone-prefix {
  height: 44px; padding: 0 14px; display: flex; align-items: center; background: var(--surface-soft);
  border-right: 1px solid var(--line); border-radius: 0; color: var(--ink-soft); font-size: 14px; font-weight: 600;
}
html :is(body, body.dark) .phone-input-wrap input, html :is(body, body.dark) .phone-input-wrap .form-input {
  border: 0 !important; border-radius: 0 !important; box-shadow: none !important; height: 44px; background: transparent; font-size: 14px;
}

/* OTP digit boxes */
html :is(body, body.dark) .otp-digits-container { display: flex; justify-content: center; gap: 8px; margin: 20px 0 16px; }
html :is(body, body.dark) .otp-digit-box {
  width: 48px; height: 52px; padding: 0; text-align: center; border: 1px solid var(--line); border-radius: 12px;
  background: #FFFFFF; color: var(--ink); font-family: var(--font-mono); font-size: 22px; font-weight: 600;
  transition: border-color .15s ease, box-shadow .15s ease;
}
html :is(body, body.dark) .otp-digit-box:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(11,95,165,.12); background: #FFFFFF; }
@media (max-width: 400px) {
  html :is(body, body.dark) .otp-digits-container { gap: 6px; }
  html :is(body, body.dark) .otp-digit-box { width: 42px; height: 48px; font-size: 20px; }
}
.code-input { font-family: var(--font-mono); font-size: 22px !important; letter-spacing: 8px; text-align: center; font-weight: 600; }
#captcha { height: 48px; font-size: 18px; letter-spacing: 6px !important; }

/* Captcha fallback + Turnstile containers: always visible and un-clipped */
.captcha-container { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.captcha-svg-box {
  background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px; padding: 4px 8px;
  display: flex; align-items: center; justify-content: center; min-height: 64px; flex: 1; min-width: 0;
}
.captcha-svg-box svg { display: block; width: 100%; max-width: 260px; height: 56px; }
.captcha-refresh-btn {
  width: 48px; height: 64px; border: 1px solid var(--line); border-radius: 12px; background: #FFFFFF; color: var(--ink-soft);
  display: grid; place-items: center; cursor: pointer; font-size: 16px; transition: background-color .15s ease;
}
.captcha-refresh-btn:hover { background: var(--surface-soft); color: var(--ink); }
html body [id^="ts-"], html body [id^="turnstile"], html body .cf-turnstile { overflow: visible !important; max-width: 100%; }
html body [id^="ts-"] iframe { max-width: none; }

/* Info cards inside flows */
html :is(body, body.dark) .security-tip-card {
  margin-top: 18px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.45; color: var(--ink-soft); text-align: left;
}
html :is(body, body.dark) .tip-shield-icon { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
html :is(body, body.dark) .email-icon-circle {
  width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; color: var(--accent); margin-bottom: 14px;
}
.email-verify-wrap { text-align: center; }

/* Mobile */
@media (max-width: 640px) {
  html body { justify-content: flex-start; padding: 24px 12px 24px; }
  .auth-container, .auth-wrapper { max-width: none; }
  html :is(body, body.dark) .auth-card { padding: 24px 18px; border-radius: 16px; }
  html body .form-input { font-size: 16px; }
}
@media (max-width: 360px) {
  html body { padding: 16px 8px; }
  html :is(body, body.dark) .auth-card { padding: 20px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
