/* ============================================================
   Student Loan Sweepstakes — Login / Registration
   Design Tokens + Full Stylesheet
   ============================================================ */

/* ── Design Tokens ──────────────────────────────────────────── */
:root {
  /* Brand Colors */
  --brand-green: #17FE9B;
  --brand-blue: #24B2FB;
  --brand-gradient: linear-gradient(135deg, #17FE9B 0%, #24B2FB 100%);

  /* Grayscale */
  --color-white: #FFFFFF;
  --color-cloud: #EDEFF7;
  --color-smoke: #D3D6E0;
  --color-steel: #BCBFCC;
  --color-space: #9DA2B3;
  --color-graphite: #6E7180;
  --color-arsenic: #40424D;
  --color-phantom: #1E1E24;
  --color-black: #1E1D1D;

  /* Semantic */
  --color-error: #EF4444;
  --color-error-bg: #FEF2F2;
  --color-success: #22C55E;
  --color-success-bg: #F0FDF4;

  /* Typography */
  --font-family: 'Manrope', sans-serif;
  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-base: 16px;
  --space-lg: 20px;
  --space-xl: 24px;
  --space-2xl: 32px;
  --space-3xl: 40px;
  --space-4xl: 48px;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-card: 0 32px 80px rgba(0, 0, 0, 0.70), 0 0 60px rgba(23, 254, 155, 0.06);
  --shadow-input-focus: 0 0 0 3px rgba(23, 254, 155, 0.14);
  --shadow-btn-hover: 0 4px 14px rgba(23, 254, 155, 0.25);

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;

  /* Dark theme tokens */
  --bg-deep:        #09090F;
  --bg-panel:       #0D0E1A;
  --bg-surface:     rgba(255, 255, 255, 0.10);
  --border-subtle:  rgba(255, 255, 255, 0.09);
  --border-green:   rgba(23, 254, 155, 0.32);
  --text-primary:   rgba(255, 255, 255, 0.92);
  --text-secondary: rgba(255, 255, 255, 0.55);
  --text-muted:     rgba(255, 255, 255, 0.32);

  /* Updated semantic backgrounds → dark variants */
  --color-error-bg:   rgba(239, 68, 68, 0.10);
  --color-success-bg: rgba(34, 197, 94, 0.10);
}

/* ── Reset & Base ───────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-weight: var(--fw-regular);
  color: var(--text-primary);
  background: var(--bg-deep);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-base);
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse at center, rgba(23, 254, 155, 0.04) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

body > * {
  position: relative;
  z-index: 1;
}

/* ── Main Container ─────────────────────────────────────────── */
.auth-container {
  display: flex;
  width: 100%;
  max-width: 1040px;
  min-height: 680px;
  background: linear-gradient(160deg, #0D0E1A 0%, #111320 100%);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

/* ── Brand Panel (Left) ─────────────────────────────────────── */
.brand-panel {
  width: 40%;
  background: rgba(9, 9, 15, 0.6);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-3xl) var(--space-2xl);
  position: relative;
  overflow: hidden;
}

/* Decorative gradient accent */
.brand-panel::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 260px;
  height: 260px;
  background: var(--brand-gradient);
  border-radius: 50%;
  opacity: 0.12;
  filter: blur(60px);
}

.brand-panel::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: -40px;
  width: 200px;
  height: 200px;
  background: var(--brand-gradient);
  border-radius: 50%;
  opacity: 0.09;
  filter: blur(50px);
}

.brand-content {
  position: relative;
  z-index: 1;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-3xl);
}

.brand-logo img {
  height: 44px;
  width: auto;
}

.brand-logo-text {
  display: flex;
  flex-direction: column;
}

.brand-logo-text span {
  font-weight: var(--fw-bold);
  font-size: 15px;
  color: var(--color-white);
  line-height: 1.2;
}

.brand-logo-text .brand-accent {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-tagline {
  font-size: 28px;
  font-weight: var(--fw-extrabold);
  color: var(--color-white);
  line-height: 1.25;
  margin-bottom: var(--space-sm);
}

.brand-tagline .gradient-text {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.48);
  line-height: 1.6;
  margin-bottom: var(--space-2xl);
}

/* Value props */
.value-props {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.value-props li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.5;
}

.value-props .check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.value-props .check svg {
  width: 11px;
  height: 11px;
}

/* Testimonial */
.brand-testimonial {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-top: var(--space-2xl);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.testimonial-quote {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.6;
  font-style: italic;
  margin-bottom: var(--space-md);
}

.testimonial-quote::before {
  content: '\201C';
  font-size: 24px;
  line-height: 0;
  vertical-align: -6px;
  margin-right: 2px;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.testimonial-author {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.36);
  font-weight: var(--fw-medium);
}

/* ── Form Panel (Right) ─────────────────────────────────────── */
.form-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--space-3xl) var(--space-3xl);
  overflow-y: auto;
}

/* ── Tab Bar ────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  padding: 3px;
  margin-bottom: var(--space-xl);
  flex-shrink: 0;
}

.tab-btn {
  flex: 1;
  padding: var(--space-sm) var(--space-base);
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: rgba(255, 255, 255, 0.48);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.tab-btn:hover:not(.active) {
  color: rgba(255, 255, 255, 0.82);
}

.tab-btn.active {
  background: var(--brand-gradient);
  color: #09090F;
  box-shadow: 0 2px 8px rgba(23, 254, 155, 0.2);
}

.tab-btn:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

/* ── Flash Messages ─────────────────────────────────────────── */
.flash-messages {
  margin-bottom: var(--space-base);
}

.flash-msg {
  padding: var(--space-md) var(--space-base);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: var(--fw-medium);
  line-height: 1.5;
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  animation: flashSlideIn 0.3s ease;
}

.flash-msg.error {
  background: var(--color-error-bg);
  color: var(--color-error);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.flash-msg.success {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.flash-msg.info {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--border-subtle);
}

@keyframes flashSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Auth Panels ────────────────────────────────────────────── */
.auth-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  animation: fadeIn 0.3s ease;
}

.auth-panel.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Form Heading ───────────────────────────────────────────── */
.form-heading {
  font-size: 24px;
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.form-subtext {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.5;
}

/* ── Social Auth ────────────────────────────────────────────── */
.social-row {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-base);
}

.social-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px var(--space-md);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.social-btn:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.30);
}

.social-btn:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

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

/* ── Divider ────────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-base);
  color: rgba(255, 255, 255, 0.30);
  font-size: 12px;
  font-weight: var(--fw-medium);
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.10);
}

.clerk-auth-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-base);
  padding: var(--space-base);
  margin-bottom: var(--space-lg);
  border: 1px solid rgba(36, 178, 251, 0.18);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(36, 178, 251, 0.08) 0%, rgba(23, 254, 155, 0.04) 100%),
    #0D0E1A;
}

.clerk-auth-card--signup {
  margin-top: var(--space-sm);
}

.clerk-auth-copy {
  min-width: 0;
}

.clerk-auth-eyebrow {
  display: inline-block;
  margin-bottom: var(--space-xs);
  font-size: 11px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-blue);
}

.clerk-auth-title {
  font-size: 14px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.72);
}

.clerk-auth-btn {
  appearance: none;
  border: 0;
  border-radius: var(--radius-full);
  padding: 12px 18px;
  background: var(--brand-gradient);
  color: #09090F;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: var(--fw-bold);
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
}

.clerk-auth-btn:hover,
.clerk-auth-btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(30, 30, 36, 0.16);
}

.clerk-auth-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.divider-live {
  margin-bottom: var(--space-lg);
}

.clerk-auth-feedback {
  margin-bottom: var(--space-base);
}

/* ── Step Indicator ─────────────────────────────────────────── */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: var(--space-sm);
}

.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: var(--fw-bold);
  color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.step-dot.active {
  background: var(--brand-gradient);
  border-color: transparent;
  color: var(--color-white);
}

.step-dot.done {
  background: var(--color-success);
  border-color: transparent;
  color: var(--color-white);
}

.step-line {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.10);
  transition: background var(--transition-fast);
}

.step-line.done {
  background: var(--color-success);
}

.step-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.step-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.38);
  font-weight: var(--fw-medium);
}

.step-label.active {
  color: rgba(255, 255, 255, 0.85);
  font-weight: var(--fw-semibold);
}

/* ── Form Fields ────────────────────────────────────────────── */
.field-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-base);
  margin-bottom: var(--space-base);
}

.field {
  display: flex;
  flex-direction: column;
}

.field label {
  font-size: 13px;
  font-weight: var(--fw-semibold);
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: var(--space-xs);
}

.field label .required {
  color: var(--color-error);
  margin-left: 2px;
}

.field input,
.field select {
  width: 100%;
  padding: 11px var(--space-md);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: var(--fw-regular);
  color: var(--text-primary);
  background: var(--bg-surface);
  transition: all var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
}

.field select {
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23FFFFFF' stroke-opacity='0.4' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.field select option {
  background: #111320;
  color: rgba(255, 255, 255, 0.88);
}

.field input::placeholder {
  color: var(--text-muted);
  font-weight: var(--fw-regular);
}

.field input:hover,
.field select:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: rgba(23, 254, 155, 0.45);
  box-shadow: var(--shadow-input-focus);
}

.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px rgba(28, 30, 47, 1) inset;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.92);
  caret-color: rgba(255, 255, 255, 0.92);
  border-color: var(--border-subtle);
  transition: background-color 5000s ease-in-out 0s;
}

.field input.invalid,
.field select.invalid {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Terms & Conditions / email-consent checkboxes — .field input above targets
   every <input> in a .field (including these) with width:100%/appearance:none
   meant for text/date/password fields, which stretched them into borderless
   full-width boxes with no visible checked state. These ID selectors outrank
   that class-based rule regardless of source order, so this overrides it
   without touching any other field. Same accent-color recipe as the other
   plain (non-toggle) checkboxes already in this codebase
   (user_dashboard.css .lf-checkbox-option, affiliate_apply.css .aff-terms-row). */
#signup-terms,
#signup-email-consent {
  width: 16px;
  height: 16px;
  min-width: 16px;
  padding: 0;
  margin: 2px 0 0;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  appearance: auto;
  -webkit-appearance: auto;
  accent-color: var(--brand-green);
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: none;
}

.field .field-error {
  font-size: 12px;
  color: var(--color-error);
  margin-top: var(--space-xs);
  font-weight: var(--fw-medium);
  display: none;
}

.field .field-error.visible {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* Two-column grid */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-base);
}

.three-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-base);
}

/* ── Forgot Password ───────────────────────────────────────── */
.forgot-link {
  text-align: right;
  margin-bottom: var(--space-base);
}

.forgot-link a {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.46);
  text-decoration: none;
  font-weight: var(--fw-medium);
  transition: color var(--transition-fast);
}

.forgot-link a:hover {
  color: var(--brand-blue);
}

.forgot-link a:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
  border-radius: 2px;
}

.resend-verification-form {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-xs);
  margin: calc(var(--space-sm) * -1) 0 var(--space-base);
}

.resend-verification-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--brand-blue);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: var(--fw-semibold);
  text-decoration: underline;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.resend-verification-btn:hover:not(:disabled) {
  color: var(--brand-green);
}

.resend-verification-btn:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
  border-radius: 2px;
}

.resend-verification-btn:disabled {
  color: var(--color-space);
  cursor: not-allowed;
  text-decoration: none;
}

.resend-verification-form .field-error {
  display: none;
  text-align: right;
  color: var(--color-error);
}

.resend-verification-form .field-error.visible {
  display: block;
  animation: fadeIn 0.2s ease;
}

.verification-success-box {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-base);
  padding: var(--space-md);
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-radius: var(--radius-md);
  background: var(--color-success-bg);
}

.verification-success-content {
  min-width: 0;
}

.verification-success-title {
  color: var(--color-success);
  font-size: 13px;
  font-weight: var(--fw-bold);
  margin-bottom: 2px;
}

.verification-success-body {
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  line-height: 1.5;
}

.verification-success-body strong {
  color: rgba(255, 255, 255, 0.82);
  word-break: break-word;
}

/* ── Scrollable Section (Step 2) ────────────────────────────── */
.scroll-section {
  max-height: 340px;
  overflow-y: auto;
  padding-right: var(--space-sm);
  margin-bottom: var(--space-base);
}

.scroll-section::-webkit-scrollbar {
  width: 5px;
}

.scroll-section::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 10px;
}

.scroll-section::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 10px;
}

.scroll-section::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.32);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 12px var(--space-xl);
  border: none;
  border-radius: var(--radius-sm);
  background: var(--brand-gradient);
  color: #09090F;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: var(--fw-bold);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-btn-hover);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  padding: 12px var(--space-xl);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.btn-secondary:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

.btn-row {
  display: flex;
  gap: var(--space-md);
}

.btn-row .btn-secondary {
  flex: 1;
}

.btn-row .btn-primary {
  flex: 2;
}

.captcha-field {
  margin-top: var(--space-base);
}

.captcha-control {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  background: rgba(255, 255, 255, 0.03);
}

.captcha-control .cap-icon {
  flex-shrink: 0;
  color: var(--brand-blue);
  margin-top: 1px;
}

.captcha-control .cap-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.captcha-control .cap-label {
  font-size: 12px;
  font-weight: var(--fw-semibold);
  color: rgba(255, 255, 255, 0.72);
}

.captcha-control .cap-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.38);
  line-height: 1.5;
}

.captcha-control .cap-sub a {
  color: rgba(255, 255, 255, 0.46);
  text-decoration: underline;
  font-weight: var(--fw-medium);
  transition: color var(--transition-fast);
}

.captcha-control .cap-sub a:hover {
  color: var(--brand-green);
}

.captcha-control.invalid {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Hide the floating reCAPTCHA v3 badge — disclosure text is shown inline instead */
.grecaptcha-badge {
  visibility: hidden !important;
}

/* ── Google Social Button (full-width) ──────────────────────── */
.social-btn--google {
  width: 100%;
  padding: 12px var(--space-base);
  font-size: 14px;
  font-weight: var(--fw-semibold);
  border-radius: var(--radius-sm);
  margin-bottom: 0;
}

.social-btn--google svg {
  width: 18px;
  height: 18px;
}

/* ── Password Input Wrapper ─────────────────────────────────── */
.input-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-password-wrap input {
  width: 100%;
  padding-right: 42px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
  border-radius: var(--radius-sm);
}

.password-toggle:hover {
  color: rgba(255, 255, 255, 0.62);
}

.password-toggle:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 1px;
}

.password-toggle.active {
  color: var(--brand-blue);
}

/* ── Branded Form Views ─────────────────────────────────────── */
.branded-form-view {
  animation: fadeIn 0.3s ease;
}

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

/* ── Clerk Form Feedback ────────────────────────────────────── */
.clerk-form-feedback {
  margin-top: var(--space-md);
  padding: var(--space-md) var(--space-base);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: var(--fw-medium);
  line-height: 1.5;
  animation: flashSlideIn 0.3s ease;
}

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

.clerk-form-feedback.feedback-error {
  background: var(--color-error-bg);
  color: var(--color-error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.clerk-form-feedback.feedback-success {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.clerk-form-feedback.feedback-info {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--border-subtle);
}

/* ── Resend Code Button ─────────────────────────────────────── */
.resend-code-btn {
  background: none;
  border: none;
  color: var(--brand-blue);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: var(--fw-semibold);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  transition: color var(--transition-fast);
}

.resend-code-btn:hover:not(:disabled) {
  color: var(--brand-green);
}

.resend-code-btn:disabled {
  color: var(--color-space);
  cursor: not-allowed;
  text-decoration: none;
}

.resend-code-btn:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Form Step Panels ───────────────────────────────────────── */
.form-step {
  display: none;
  flex-direction: column;
  flex: 1;
  animation: stepFadeIn 0.3s ease;
}

.form-step.active {
  display: flex;
}

@keyframes stepFadeIn {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ── Terms Text ─────────────────────────────────────────────── */
.terms-text {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.36);
  text-align: center;
  margin-top: var(--space-md);
  line-height: 1.6;
}

.terms-text a {
  color: rgba(255, 255, 255, 0.52);
  text-decoration: underline;
  font-weight: var(--fw-medium);
  transition: color var(--transition-fast);
}

.terms-text a:hover {
  color: var(--brand-green);
}

.switch-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.46);
  text-align: center;
  margin-top: var(--space-md);
}

.switch-text button {
  background: none;
  border: none;
  color: var(--brand-blue);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: var(--fw-semibold);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.switch-text button:hover {
  color: var(--brand-green);
}

.switch-text button:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Spacer ─────────────────────────────────────────────────── */
.form-spacer {
  flex: 1;
}

/* ── Responsive: Tablet (≤ 900px) ───────────────────────────── */
@media (max-width: 900px) {
  .brand-panel {
    width: 38%;
    padding: var(--space-2xl) var(--space-lg);
  }

  .brand-tagline {
    font-size: 22px;
  }

  .form-panel {
    padding: var(--space-2xl) var(--space-xl);
  }

  .three-col {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Responsive: Mobile (≤ 768px) ───────────────────────────── */
@media (max-width: 768px) {
  body {
    padding: 0;
    align-items: stretch;
  }

  .auth-container {
    flex-direction: column;
    border-radius: 0;
    min-height: 100vh;
    max-width: 100%;
    box-shadow: none;
  }

  /* Brand panel → compact header bar */
  .brand-panel {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: var(--space-base) var(--space-lg);
    min-height: auto;
    gap: var(--space-md);
  }

  .brand-panel::before,
  .brand-panel::after {
    display: none;
  }

  .brand-content {
    display: flex;
    align-items: center;
    gap: var(--space-md);
  }

  .brand-logo {
    margin-bottom: 0;
  }

  .brand-logo img {
    height: 32px;
  }

  .brand-logo-text span {
    font-size: 13px;
  }

  .brand-tagline,
  .brand-subtitle,
  .value-props,
  .brand-testimonial {
    display: none;
  }

  /* Form panel full width */
  .form-panel {
    padding: var(--space-xl) var(--space-lg);
    flex: 1;
  }

  .form-heading {
    font-size: 20px;
  }

  .two-col,
  .three-col {
    grid-template-columns: 1fr;
  }

  .social-btn span.social-label {
    display: none;
  }

  .social-btn {
    padding: 10px;
    justify-content: center;
  }

  .clerk-auth-card {
    flex-direction: column;
    align-items: stretch;
  }

  .clerk-auth-btn {
    width: 100%;
  }

  .scroll-section {
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
  }

  .btn-row {
    flex-direction: column-reverse;
    gap: var(--space-sm);
  }

  .btn-row .btn-secondary,
  .btn-row .btn-primary {
    flex: none;
    width: 100%;
  }
}

/* ── Responsive: Small phones (≤ 400px) ─────────────────────── */
@media (max-width: 400px) {
  .form-panel {
    padding: var(--space-base) var(--space-base);
  }

  .social-row {
    gap: var(--space-xs);
  }
}

/* ── Focus Visible Global ───────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

/* ── Marketing Preferences ──────────────────────────────────── */
.marketing-prefs {
  margin-top: var(--space-md);
}

.marketing-prefs__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.marketing-prefs__title {
  font-size: 13px;
  font-weight: var(--fw-semibold);
  color: rgba(255, 255, 255, 0.78);
}

.marketing-prefs__badge {
  font-size: 10px;
  font-weight: var(--fw-semibold);
  color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.07);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.marketing-prefs__card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* Individual preference row */
.marketing-pref-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-base);
  cursor: pointer;
  transition: background var(--transition-fast);
  position: relative;
}

.marketing-pref-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.marketing-pref-item + .marketing-pref-item {
  border-top: 1px solid var(--border-subtle);
}

/* Icon */
.marketing-pref-item__icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(23, 254, 155, 0.1) 0%, rgba(36, 178, 251, 0.1) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-blue);
}

/* Text block */
.marketing-pref-item__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.marketing-pref-item__label {
  font-size: 13px;
  font-weight: var(--fw-semibold);
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.3;
}

.marketing-pref-item__desc {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.40);
  line-height: 1.4;
}

/* Hide native checkbox */
.marketing-pref-item__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Custom toggle */
.marketing-pref-item__toggle {
  flex-shrink: 0;
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.16);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.marketing-pref-item__toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform var(--transition-fast);
}

/* Checked state */
.marketing-pref-item__input:checked ~ .marketing-pref-item__toggle {
  background: var(--brand-gradient);
}

.marketing-pref-item__input:checked ~ .marketing-pref-item__toggle::after {
  transform: translateX(16px);
}

/* Focus ring on toggle */
.marketing-pref-item__input:focus-visible ~ .marketing-pref-item__toggle {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

/* Disclosure text */
.marketing-prefs__disclosure {
  margin-top: var(--space-xs);
}

.marketing-prefs__disclosure p {
  margin: var(--space-xs) 0 0;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.36);
  line-height: 1.45;
}

.marketing-prefs__disclosure a {
  color: rgba(255, 255, 255, 0.52);
  text-decoration: underline;
  font-weight: var(--fw-medium);
  transition: color var(--transition-fast);
}

.marketing-prefs__disclosure a:hover {
  color: var(--brand-green);
}

/* ── Sign-up Email Verification Step ───────────────────────── */
.signup-verify-step {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  animation: fadeIn 0.3s ease;
}

.signup-verify-step[hidden] {
  display: none;
}

.verify-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(23, 254, 155, 0.1) 0%, rgba(36, 178, 251, 0.1) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-base);
}

.verify-heading {
  font-size: 20px;
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.verify-subtext {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: var(--space-lg);
}

.verify-subtext strong {
  color: rgba(255, 255, 255, 0.82);
  word-break: break-word;
}

.verify-code-field {
  margin-bottom: var(--space-lg);
}

.verify-code-field input {
  font-size: 22px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.35em;
  text-align: center;
  padding: 14px var(--space-md);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.verify-code-field input:focus {
  border-color: var(--brand-blue);
  box-shadow: var(--shadow-input-focus);
  outline: none;
}

.verify-resend-btn {
  background: none;
  border: none;
  padding: 0;
  margin-top: var(--space-md);
  color: rgba(255, 255, 255, 0.46);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: var(--fw-regular);
  cursor: pointer;
  text-align: center;
  line-height: 1.5;
  transition: color var(--transition-fast);
}

.verify-resend-btn:hover:not(:disabled) {
  color: rgba(255, 255, 255, 0.82);
}

.verify-resend-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.verify-resend-label {
  color: var(--brand-blue);
  font-weight: var(--fw-semibold);
  text-decoration: underline;
}

.verify-resend-btn:hover:not(:disabled) .verify-resend-label {
  color: var(--brand-green);
}

/* ── Loading spinner for buttons ────────────────────────────── */
.btn-primary.loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn-primary.loading::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--color-white);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: var(--space-sm);
  vertical-align: middle;
}

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

/* ── Referral Pending Banner ─────────────────────────────────── */
.referral-banner {
  padding: var(--space-md) var(--space-base);
  border-radius: var(--radius-sm);
  background: var(--color-success-bg);
  color: var(--color-success);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: var(--space-base);
  border: 1px solid rgba(34, 197, 94, 0.3);
}
