/* ═══════════════════════════════════════════════════════════════
   RADIANT — Premium Auth (login / signup / forgot-password)
   Split brand panel + glass form card. Home design language.
   Keeps all class/id hooks used by js/auth.js and page scripts.
   ═══════════════════════════════════════════════════════════════ */

.auth-page {
  position: relative;
  min-height: 100vh;
  padding: calc(var(--nav-height, 90px) + 32px) 24px 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ro-paper, #f6f8fe);
  overflow: hidden;
}

/* Soft paper ambient behind the card */
.auth-page::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 12% 20%, rgba(18, 97, 255, 0.12), transparent 42%),
    radial-gradient(ellipse at 88% 70%, rgba(114, 168, 255, 0.1), transparent 45%);
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  border-radius: 32px;
  overflow: hidden;
  border: 1px solid rgba(10, 34, 83, 0.1);
  background: #fff;
  box-shadow:
    0 40px 100px rgba(8, 28, 80, 0.14),
    0 8px 24px rgba(8, 28, 80, 0.06),
    inset 0 1px 0 #fff;
}

/* ── Brand panel (left) ── */
.auth-brand {
  position: relative;
  padding: 52px 44px;
  color: #fff;
  background:
    radial-gradient(circle at 72% 28%, rgba(31, 105, 255, 0.32), transparent 36%),
    linear-gradient(155deg, #07132e 0%, #071c4d 48%, #061a45 100%);
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 560px;
}
.auth-brand .ro-hero-atmosphere { inset: 0; }
.auth-brand-inner { position: relative; z-index: 2; }

.auth-brand-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  color: rgba(219, 233, 255, 0.72);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.auth-brand-kicker i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #85b2ff;
  box-shadow: 0 0 0 5px rgba(133, 178, 255, 0.12);
  animation: roPulse 2.8s ease-in-out infinite;
}

.auth-brand h2 {
  margin: 0;
  font-family: var(--ro-display, "Plus Jakarta Sans", sans-serif);
  font-size: clamp(2.2rem, 3.4vw, 3.15rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: #fff;
}
.auth-brand h2 em {
  font-style: normal;
  color: #7eb0ff;
}
.auth-brand-lede {
  max-width: 360px;
  margin: 18px 0 0;
  color: rgba(232, 240, 255, 0.62);
  font-size: 0.98rem;
  line-height: 1.7;
}

.auth-features {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 40px;
}
.auth-feat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  font-size: 0.86rem;
  font-weight: 600;
  color: rgba(240, 246, 255, 0.88);
  letter-spacing: -0.01em;
}
.auth-feat-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 9px;
  background: linear-gradient(145deg, #2974ff, #0b4ee7);
  box-shadow: 0 8px 18px rgba(0, 55, 190, 0.35);
}
.auth-feat-icon svg {
  width: 14px;
  height: 14px;
  stroke: #fff;
  stroke-width: 2.6;
}

.auth-brand-foot {
  position: relative;
  z-index: 2;
  margin-top: 36px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(222, 235, 255, 0.45);
  font-size: 0.72rem;
  font-weight: 600;
}
.auth-brand-foot img {
  height: 28px;
  width: auto;
  filter: brightness(1.2) contrast(1.1) saturate(1.2);
}

/* ── Form panel (right) ── */
.auth-panel {
  padding: 48px 44px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9ff 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.form-header { margin-bottom: 28px; }
.form-title {
  margin: 0;
  font-family: var(--ro-display, "Plus Jakarta Sans", sans-serif);
  font-size: clamp(1.7rem, 2.4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ro-ink, #0a1531);
  line-height: 1.15;
}
.form-sub {
  margin: 10px 0 0;
  color: var(--ro-copy, #4d5b73);
  font-size: 0.95rem;
  line-height: 1.6;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.form-group label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ro-ink, #0a1531);
  letter-spacing: 0.01em;
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input:not([type="checkbox"]) {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1.5px solid rgba(10, 34, 83, 0.12);
  background: #fff;
  color: var(--ro-ink, #0a1531);
  font-family: var(--ro-body, Inter, sans-serif);
  font-size: 0.95rem;
  font-weight: 500;
  transition: border-color 0.22s, box-shadow 0.22s, background 0.22s;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8), 0 8px 20px rgba(12, 42, 101, 0.03);
}
.form-group input::placeholder { color: rgba(77, 91, 115, 0.45); font-weight: 450; }
.form-group input:hover { border-color: rgba(18, 97, 255, 0.28); }
.form-group input:focus {
  outline: none;
  border-color: rgba(18, 97, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(18, 97, 255, 0.14), 0 10px 28px rgba(12, 42, 101, 0.06);
}
.form-group input.error {
  border-color: rgba(220, 38, 38, 0.55) !important;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1) !important;
}
.form-group input.valid {
  border-color: rgba(5, 150, 105, 0.5) !important;
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.1) !important;
}

.helper-text {
  min-height: 1.1em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ro-copy, #4d5b73);
  line-height: 1.4;
}
.helper-text.err { color: #dc2626; }
.helper-text.ok { color: #059669; }
.helper-text.chk { color: var(--ro-blue, #1261ff); }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 48px !important; }
.pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--ro-copy, #4d5b73);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.pw-toggle:hover { color: var(--ro-ink, #0a1531); background: rgba(18, 97, 255, 0.06); }
.pw-toggle svg { width: 18px; height: 18px; }

.pw-strength {
  height: 4px;
  border-radius: 100px;
  background: rgba(10, 34, 83, 0.08);
  overflow: hidden;
  margin-top: 2px;
}
.pw-strength-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: #94a3b8;
  transition: width 0.3s ease, background 0.3s ease;
}
.pw-strength-bar.str-weak,
.pw-strength-bar.weak { width: 33%; background: #ef4444; }
.pw-strength-bar.str-medium,
.pw-strength-bar.fair { width: 66%; background: #f59e0b; }
.pw-strength-bar.str-strong,
.pw-strength-bar.strong { width: 100%; background: #10b981; }


.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 550;
  color: var(--ro-copy, #4d5b73);
  line-height: 1.45;
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
  width: 17px;
  height: 17px;
  min-width: 17px;
  margin-top: 1px;
  accent-color: var(--ro-blue, #1261ff);
  cursor: pointer;
}
.checkbox-label a {
  color: var(--ro-blue, #1261ff);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.form-forgot {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ro-blue, #1261ff);
  transition: color 0.2s;
}
.form-forgot:hover { color: var(--ro-blue-deep, #073dc6); }

.submit-btn,
#loginBtn,
#submitBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  margin-bottom: 8px;
  padding: 0 22px;
  border: 1px solid rgba(163, 195, 255, 0.42);
  border-radius: 16px;
  color: #fff;
  font-family: var(--ro-ui, "Plus Jakarta Sans", sans-serif);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(145deg, #2974ff, #0b4ee7 65%, #073bbf);
  box-shadow: 0 16px 36px rgba(0, 55, 190, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  cursor: pointer;
  transition: transform 0.28s var(--ro-ease, cubic-bezier(0.16, 1, 0.3, 1)), box-shadow 0.28s ease;
}
.submit-btn:hover,
#loginBtn:hover,
#submitBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 48px rgba(0, 55, 190, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.34);
}
.submit-btn:disabled,
#loginBtn:disabled,
#submitBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.form-divider {
  position: relative;
  text-align: center;
  margin: 22px 0 16px;
}
.form-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(10, 34, 83, 0.1);
}
.form-divider span {
  position: relative;
  z-index: 1;
  padding: 0 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9ff 100%);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(77, 91, 115, 0.7);
}

.signup-btn,
.signin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  padding: 0 20px;
  border-radius: 14px;
  border: 1.5px solid rgba(10, 34, 83, 0.14);
  background: #fff;
  color: var(--ro-ink, #0a1531);
  font-family: var(--ro-ui, "Plus Jakarta Sans", sans-serif);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(12, 42, 101, 0.05);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.signup-btn:hover,
.signin-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(18, 97, 255, 0.3);
  background: rgba(18, 97, 255, 0.04);
  box-shadow: 0 12px 28px rgba(12, 42, 101, 0.08);
}

/* Captcha */
.captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.captcha-q {
  display: grid;
  place-items: center;
  min-width: 88px;
  min-height: 52px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1.5px solid rgba(18, 97, 255, 0.18);
  background: rgba(18, 97, 255, 0.06);
  font-family: var(--ro-mono, "JetBrains Mono", monospace);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ro-ink, #0a1531);
}
.captcha-eq {
  font-weight: 800;
  color: var(--ro-copy, #4d5b73);
}
.captcha-ans {
  flex: 1;
  max-width: 100px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.captcha-ans.error {
  border-color: rgba(220, 38, 38, 0.55) !important;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1) !important;
}
.captcha-ans.valid {
  border-color: rgba(5, 150, 105, 0.5) !important;
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.1) !important;
}
.terms-row { margin-bottom: 20px; }
.submit-hint {
  margin: 0 0 4px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(77, 91, 115, 0.65);
}
.forgot-link {
  display: block;
  margin-top: 14px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ro-blue, #1261ff);
}
.forgot-link:hover { color: var(--ro-blue-deep, #073dc6); }

.captcha-refresh {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(10, 34, 83, 0.12);
  background: #fff;
  color: var(--ro-copy, #4d5b73);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.captcha-refresh:hover {
  color: var(--ro-blue, #1261ff);
  border-color: rgba(18, 97, 255, 0.3);
  background: rgba(18, 97, 255, 0.05);
}
.captcha-refresh svg { width: 18px; height: 18px; }

.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(18, 97, 255, 0.25);
  border-top-color: var(--ro-blue, #1261ff);
  border-radius: 50%;
  animation: authSpin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}
@keyframes authSpin { to { transform: rotate(360deg); } }

/* Modal */
.custom-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 11000;
  background: rgba(7, 17, 42, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.custom-modal-overlay.active { display: flex; }
.custom-modal {
  width: 100%;
  max-width: 440px;
  padding: 0;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: linear-gradient(180deg, #fff, #f3f7ff);
  box-shadow: 0 32px 80px rgba(0, 20, 80, 0.28);
  overflow: hidden;
}
.custom-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(10, 34, 83, 0.08);
}
.custom-modal-header h3 {
  margin: 0;
  font-family: var(--ro-display, "Plus Jakarta Sans", sans-serif);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ro-ink, #0a1531);
}
.custom-modal-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(10, 34, 83, 0.1);
  background: #fff;
  color: var(--ro-copy, #4d5b73);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
}
.custom-modal-close:hover { color: var(--ro-ink, #0a1531); background: rgba(18, 97, 255, 0.06); }
.custom-modal-body {
  padding: 20px 24px;
  font-size: 0.92rem;
  color: var(--ro-copy, #4d5b73);
  line-height: 1.65;
}
.custom-modal-body p { margin: 0; }
.custom-modal-footer {
  padding: 14px 24px 20px;
  display: flex;
  justify-content: flex-end;
}
.custom-modal-btn {
  min-height: 44px;
  padding: 0 22px;
  border-radius: 12px;
  border: none;
  color: #fff;
  font-weight: 700;
  font-family: var(--ro-ui, "Plus Jakarta Sans", sans-serif);
  background: linear-gradient(145deg, #2974ff, #0b4ee7);
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 55, 190, 0.25);
}

/* Compact single-column (forgot password) */
.auth-shell.auth-shell-compact {
  grid-template-columns: 1fr;
  max-width: 480px;
}
.auth-shell.auth-shell-compact .auth-brand { display: none; }
.auth-shell.auth-shell-compact .auth-panel {
  padding: 44px 36px;
}

@media (max-width: 920px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand {
    min-height: auto;
    padding: 36px 32px 32px;
  }
  .auth-features { margin-top: 24px; }
  .auth-brand-foot { margin-top: 24px; }
  .auth-panel { padding: 36px 28px 40px; }
}
@media (max-width: 520px) {
  .auth-page { padding: calc(var(--nav-height, 78px) + 16px) 14px 40px; }
  .auth-shell { border-radius: 24px; }
  .auth-brand { padding: 28px 22px; }
  .auth-panel { padding: 28px 20px 32px; }
  .auth-feat { font-size: 0.8rem; }
}
