/* ═══════════════════════════════════════════════════
   auth.css  —  Finsight Core authentication pages
   Standalone stylesheet — does NOT depend on base.css
   ═══════════════════════════════════════════════════ */

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

:root {
  --ink:     #0a0c10;
  --ink2:    #111520;
  --ink3:    #161c2c;
  --ink4:    #1d2538;
  --ink5:    #232e47;
  --signal:  #4fffb0;
  --signal2: #00d97e;
  --signal3: #a8ffd6;
  --amber:   #ffb84d;
  --rose:    #ff6b6b;
  --ice:     #c8d6ff;
  --white:   #ffffff;
  --paper:   #e8eef8;
  --line:    rgba(200, 214, 255, 0.10);
  --line2:   rgba(79,  255, 176, 0.20);
  --ghost:   rgba(200, 214, 255, 0.08);
}

html { height: 100%; }

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--ink);
  color: var(--paper);
  min-height: 100%;
  overflow-x: hidden;
}

/* ── AMBIENT BACKGROUND ── */
.auth-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.auth-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.5;
}

.auth-bg-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.auth-bg-orb1 {
  width: 600px;
  height: 600px;
  top: -150px;
  left: -150px;
  background: radial-gradient(circle, rgba(79, 255, 176, 0.05) 0%, transparent 65%);
}

.auth-bg-orb2 {
  width: 500px;
  height: 500px;
  bottom: -100px;
  right: -100px;
  background: radial-gradient(circle, rgba(79, 255, 176, 0.04) 0%, transparent 65%);
}

.auth-bg-lines {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  opacity: 0.6;
}

.auth-bg-lines svg {
  width: 100%;
  height: 100%;
}

/* ── AUTH SHELL (two-column layout) ── */
.auth-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* ── LEFT PANEL (branding) ── */
.auth-panel {
  background: var(--ink2);
  border-right: 1px solid var(--line);
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

/* Logo */
.auth-panel-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.auth-panel-logo-mark {
  width: 36px;
  height: 36px;
  background: var(--ink3);
  border: 1px solid var(--line2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.auth-panel-logo-mark::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 45%;
  background: linear-gradient(to top, rgba(79, 255, 176, 0.22), transparent);
}

.auth-panel-logo-mark svg {
  width: 18px; height: 18px;
  position: relative; z-index: 1;
}

.auth-panel-logo-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.3px;
}

.auth-panel-logo-name span { color: var(--signal); font-weight: 300; }

/* Panel body */
.auth-panel-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 0;
}

.auth-panel-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--signal);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-panel-eyebrow::before {
  content: '';
  width: 20px;
  height: 1px;
  background: var(--signal);
}

.auth-panel-h {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(32px, 3vw, 48px);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -1.5px;
  color: var(--white);
  margin-bottom: 14px;
}

.auth-panel-h em { font-style: italic; color: var(--signal); }

.auth-panel-sub {
  font-size: 14px;
  color: rgba(200, 214, 255, 0.6);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 320px;
}

/* Signal preview cards */
.auth-signal-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 32px;
}

.auth-signal-card {
  background: var(--ink3);
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 10px;
  padding: 12px 14px;
}

.auth-signal-card.buy  { border-left-color: var(--signal); }
.auth-signal-card.sell { border-left-color: var(--rose); }

.auth-signal-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  flex-wrap: wrap;
}

.auth-signal-ticker {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  flex: 1;
}

.auth-signal-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
}

.badge-buy  { background: rgba(79,  255, 176, 0.12); color: var(--signal); }
.badge-sell { background: rgba(255, 107, 107, 0.12); color: var(--rose); }

.auth-signal-conf {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: rgba(200, 214, 255, 0.5);
}

.auth-signal-bar {
  height: 3px;
  background: var(--ink4);
  border-radius: 2px;
  margin-bottom: 7px;
  overflow: hidden;
}

.auth-signal-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 1s ease;
}

.fill-buy  { background: var(--signal); }
.fill-sell { background: var(--rose); }

.auth-signal-text {
  font-size: 11px;
  color: rgba(200, 214, 255, 0.5);
  line-height: 1.5;
}

/* Social proof */
.auth-panel-proof {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-proof-avatars {
  display: flex;
}

.auth-proof-av {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--ink2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: white;
  margin-left: -8px;
  flex-shrink: 0;
}

.auth-proof-av:first-child { margin-left: 0; }

.auth-proof-text {
  font-size: 12px;
  color: rgba(200, 214, 255, 0.5);
  line-height: 1.5;
}

.auth-proof-text strong { color: var(--paper); }

/* Panel footer */
.auth-panel-footer {
  display: flex;
  gap: 20px;
  flex-shrink: 0;
}

.auth-panel-link {
  font-size: 12px;
  color: rgba(200, 214, 255, 0.4);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* ── RIGHT PANEL (form area) ── */
.auth-form-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 100vh;
  padding: 40px 32px;
}

/* Mobile logo (only visible below 768px) */
.auth-mobile-logo {
  display: none;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-bottom: 32px;
  align-self: flex-start;
}

.auth-form-wrap {
  width: 100%;
  max-width: 420px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-form-footer {
  display: flex;
  gap: 20px;
  flex-shrink: 0;
  margin-top: 32px;
}

.auth-form-footer a {
  font-size: 12px;
  color: rgba(200, 214, 255, 0.35);
  text-decoration: none;
  transition: color 0.2s;
}

.auth-form-footer a:hover { color: var(--paper); }

/* ── FORM COMMON STYLES ── */
.auth-heading {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -1.2px;
  color: var(--white);
  margin-bottom: 8px;
}

.auth-heading em { font-style: italic; color: var(--signal); }

.auth-subheading {
  font-size: 14px;
  color: rgba(200, 214, 255, 0.55);
  line-height: 1.65;
  margin-bottom: 28px;
}

.auth-subheading a {
  color: var(--signal);
  text-decoration: none;
  font-weight: 600;
}

.auth-subheading a:hover { color: var(--signal3); }

/* Social buttons */
.auth-social-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 22px;
}

.auth-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 16px;
  background: var(--ink3);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--paper);
  font-size: 13px;
  font-weight: 500;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  white-space: nowrap;
}

.auth-social-btn:hover {
  border-color: rgba(200, 214, 255, 0.25);
  background: var(--ink4);
  transform: translateY(-1px);
}

.auth-social-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

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

.auth-divider span {
  font-size: 11px;
  color: rgba(200, 214, 255, 0.35);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Form fields */
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 14px;
}

.auth-field:last-of-type { margin-bottom: 0; }

.auth-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(200, 214, 255, 0.7);
  letter-spacing: 0.3px;
}

.auth-input-wrap {
  position: relative;
}

.auth-input {
  width: 100%;
  padding: 12px 14px;
  padding-left: 42px; /* icon space */
  background: var(--ink3);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--white);
  font-size: 14px;
  font-family: 'Space Grotesk', sans-serif;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input:focus {
  border-color: var(--line2);
  box-shadow: 0 0 0 3px rgba(79, 255, 176, 0.06);
}

.auth-input.error {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.06);
}

.auth-input::placeholder { color: rgba(200, 214, 255, 0.3); }

/* Input icon */
.auth-input-icon {
  position: absolute;
  top: 50%;
  left: 13px;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: rgba(200, 214, 255, 0.35);
  pointer-events: none;
}

/* Password toggle */
.auth-pw-toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(200, 214, 255, 0.4);
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.auth-pw-toggle:hover { color: var(--paper); }

.auth-pw-toggle svg { width: 16px; height: 16px; }

/* When password visible — shift input padding */
.auth-input.has-toggle { padding-right: 42px; }

/* Password strength meter */
.auth-pw-strength {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.auth-pw-bar {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--ink4);
  transition: background 0.3s;
}

.auth-pw-bar.weak   { background: var(--rose); }
.auth-pw-bar.fair   { background: var(--amber); }
.auth-pw-bar.strong { background: var(--signal); }

.auth-pw-label {
  font-size: 11px;
  margin-top: 4px;
  font-weight: 500;
}

.auth-pw-label.weak   { color: var(--rose); }
.auth-pw-label.fair   { color: var(--amber); }
.auth-pw-label.strong { color: var(--signal); }

/* Field error message */
.auth-field-error {
  font-size: 11px;
  color: var(--rose);
  margin-top: 4px;
  display: none;
}

.auth-field-error.visible { display: block; }

/* Form-level error/success banners */
.auth-banner {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 16px;
  display: none;
}

.auth-banner.visible { display: block; }

.auth-banner.error   { background: rgba(255, 107, 107, 0.1); border: 1px solid rgba(255, 107, 107, 0.25); color: #ff9999; }
.auth-banner.success { background: rgba(79,  255, 176, 0.1); border: 1px solid var(--line2); color: var(--signal3); }

/* Row utility (inline fields, checkbox+label etc.) */
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

/* Checkbox */
.auth-check-wrap {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  cursor: pointer;
}

.auth-checkbox {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  background: var(--ink3);
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  margin-top: 1px;
  transition: background 0.15s, border-color 0.15s;
  position: relative;
}

.auth-checkbox:checked {
  background: var(--signal);
  border-color: var(--signal);
}

.auth-checkbox:checked::after {
  content: '';
  position: absolute;
  top: 2px; left: 4px;
  width: 5px; height: 8px;
  border: 2px solid var(--ink);
  border-top: none;
  border-left: none;
  transform: rotate(42deg);
}

.auth-check-label {
  font-size: 13px;
  color: rgba(200, 214, 255, 0.6);
  line-height: 1.5;
}

.auth-check-label a {
  color: var(--signal);
  text-decoration: none;
}

.auth-check-label a:hover { color: var(--signal3); }

/* Forgot password link */
.auth-forgot {
  font-size: 12px;
  color: rgba(200, 214, 255, 0.45);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
  flex-shrink: 0;
}

.auth-forgot:hover { color: var(--signal); }

/* Submit button */
.auth-submit {
  width: 100%;
  padding: 13px;
  border-radius: 10px;
  border: none;
  background: var(--signal);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, opacity 0.2s;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.2px;
}

.auth-submit:hover:not(:disabled) { background: var(--signal3); transform: translateY(-1px); }
.auth-submit:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* Spinner inside submit */
.auth-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(10, 12, 16, 0.3);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  display: none;
}

.auth-submit.loading .auth-spinner { display: block; }
.auth-submit.loading .auth-submit-text { display: none; }

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

/* Switch link below form */
.auth-switch {
  text-align: center;
  font-size: 13px;
  color: rgba(200, 214, 255, 0.5);
  margin-top: 20px;
}

.auth-switch a {
  color: var(--signal);
  text-decoration: none;
  font-weight: 600;
}

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

/* OTP / verification code input */
.auth-otp-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 24px 0;
}

.auth-otp-input {
  width: 48px;
  height: 56px;
  text-align: center;
  background: var(--ink3);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--white);
  font-size: 22px;
  font-family: 'DM Mono', monospace;
  font-weight: 500;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-otp-input:focus {
  border-color: var(--line2);
  box-shadow: 0 0 0 3px rgba(79, 255, 176, 0.06);
}

.auth-otp-input.filled {
  border-color: rgba(79, 255, 176, 0.3);
  background: rgba(79, 255, 176, 0.04);
}

/* Resend link */
.auth-resend {
  text-align: center;
  font-size: 13px;
  color: rgba(200, 214, 255, 0.45);
  margin-top: 8px;
}

.auth-resend-btn {
  background: none;
  border: none;
  color: var(--signal);
  font-size: 13px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}

.auth-resend-btn:disabled { color: rgba(200, 214, 255, 0.3); cursor: default; }
.auth-resend-btn:not(:disabled):hover { color: var(--signal3); }

/* Progress steps (register multi-step) */
.auth-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 28px;
}

.auth-step {
  display: flex;
  align-items: center;
  flex: 1;
}

.auth-step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--ink3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: rgba(200, 214, 255, 0.4);
  flex-shrink: 0;
  transition: all 0.3s;
  z-index: 1;
  position: relative;
}

.auth-step.active   .auth-step-circle { border-color: var(--signal); color: var(--signal); background: rgba(79, 255, 176, 0.08); }
.auth-step.complete .auth-step-circle { border-color: var(--signal); background: var(--signal); color: var(--ink); }

.auth-step-line {
  flex: 1;
  height: 1px;
  background: var(--line);
  transition: background 0.3s;
}

.auth-step.complete + .auth-step .auth-step-line,
.auth-step.complete .auth-step-line { background: rgba(79, 255, 176, 0.3); }

.auth-step-label {
  font-size: 10px;
  color: rgba(200, 214, 255, 0.4);
  text-align: center;
  margin-top: 5px;
  white-space: nowrap;
}

.auth-step.active   .auth-step-label { color: var(--signal); }
.auth-step.complete .auth-step-label { color: rgba(200, 214, 255, 0.6); }

/* Plan selector on register */
.auth-plan-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.auth-plan-card {
  padding: 14px;
  background: var(--ink3);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.auth-plan-card:hover { border-color: rgba(200, 214, 255, 0.25); }

.auth-plan-card.selected {
  border-color: var(--signal);
  background: rgba(79, 255, 176, 0.05);
}

.auth-plan-card input[type="radio"] { display: none; }

.auth-plan-name { font-size: 13px; font-weight: 600; color: var(--white); margin-bottom: 2px; }
.auth-plan-price { font-size: 12px; color: rgba(200, 214, 255, 0.5); }

.auth-plan-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--ink4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.auth-plan-card.selected .auth-plan-check {
  background: var(--signal);
  border-color: var(--signal);
}

.auth-plan-card.selected .auth-plan-check::after {
  content: '✓';
  font-size: 9px;
  color: var(--ink);
  font-weight: 800;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }

  .auth-panel {
    display: none; /* hidden on mobile — branding moves to mobile logo */
  }

  .auth-form-panel {
    padding: 32px 24px;
    min-height: 100vh;
  }

  .auth-mobile-logo { display: flex; }
}

@media (max-width: 480px) {
  .auth-form-panel { padding: 24px 20px; }
  .auth-social-row { grid-template-columns: 1fr; }
  .auth-otp-input  { width: 40px; height: 50px; font-size: 20px; }
}
