/* ============================================================
   AUTH PAGES – Unified Dark CI Theme
   Matches marketing design system (Indigo #6366f1)
   ============================================================ */

/* ── 1. Design Tokens ─────────────────────────────────── */
:root {
  --auth-accent:        #6366f1;
  --auth-accent-hover:  #818cf8;
  --auth-accent-dim:    #4f46e5;
  --auth-accent-subtle: rgba(99, 102, 241, 0.12);
  --auth-accent-glow:   rgba(99, 102, 241, 0.35);

  --auth-success:       #10b981;
  --auth-success-dim:   #059669;
  --auth-danger:        #f43f5e;
  --auth-warning:       #f59e0b;

  --auth-bg:            #09090b;
  --auth-bg-card:       #111113;
  --auth-bg-elevated:   #18181b;
  --auth-bg-input:      #1c1c1f;

  --auth-text:          #fafafa;
  --auth-text-muted:    #a1a1aa;
  --auth-text-subtle:   #71717a;

  --auth-stroke:        rgba(255, 255, 255, 0.08);
  --auth-stroke-hover:  rgba(255, 255, 255, 0.14);
  --auth-glass-bg:      rgba(255, 255, 255, 0.03);
  --auth-glass-border:  rgba(255, 255, 255, 0.06);

  --auth-radius-sm:     6px;
  --auth-radius-md:     10px;
  --auth-radius-lg:     16px;

  --auth-shadow-md:     0 4px 12px rgba(0, 0, 0, 0.25);
  --auth-shadow-lg:     0 8px 30px rgba(0, 0, 0, 0.3);
  --auth-shadow-glow:   0 0 40px var(--auth-accent-glow);

  --auth-ease:          cubic-bezier(0.16, 1, 0.3, 1);
  --auth-duration:      0.3s;
}


/* ── 2. Reset & Base ──────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body.auth-page {
  font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--auth-text);
  background: var(--auth-bg);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
a:focus-visible {
  outline: 2px solid var(--auth-accent);
  outline-offset: 2px;
  border-radius: 2px;
}
img, svg { display: block; max-width: 100%; height: auto; }

::selection {
  background: var(--auth-accent);
  color: #fff;
}


/* ── 3. Layout ────────────────────────────────────────── */
.auth-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Left panel — form */
.auth-left {
  flex: 1 1 50%;
  max-width: 50%;
  display: flex;
  flex-direction: column;
  padding: 2rem 3rem;
  position: relative;
  z-index: 2;
  /* Subtle radial glow anchors the card area visually */
  background: radial-gradient(ellipse at 50% 50%, rgba(99, 102, 241, 0.03) 0%, transparent 70%);
  border-right: 1px solid var(--auth-stroke);
}

/* Right panel — visual / 3D */
.auth-right {
  flex: 1 1 50%;
  max-width: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0f0f14 0%, #111118 50%, #0d0d12 100%);
}


/* ── 4. Left Panel Structure ──────────────────────────── */
.auth-header {
  flex-shrink: 0;
  padding-bottom: 1rem;
}

.auth-logo {
  height: 44px;
  width: auto;
  /* Original SVG is #262356 (dark) — invert + hue-rotate to make it light/readable */
  filter: brightness(0) invert(1) brightness(0.92);
}

.auth-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-footer {
  flex-shrink: 0;
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--auth-text-subtle);
}

.auth-footer a {
  color: var(--auth-text-subtle);
  transition: color var(--auth-duration) var(--auth-ease);
}

.auth-footer a:hover {
  color: var(--auth-text-muted);
}

.auth-legal-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-legal-sep {
  color: var(--auth-stroke-hover);
  user-select: none;
}


/* ── 5. Card (Glass) ─────────────────────────────────── */
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--auth-bg-card);
  border: 1px solid var(--auth-stroke);
  border-radius: var(--auth-radius-lg);
  padding: 2.5rem;
  box-shadow: var(--auth-shadow-lg);
  /* Fade-in on load */
  animation: auth-card-enter 0.5s var(--auth-ease) both;
}

@keyframes auth-card-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Wider card for register */
.auth-card--wide {
  max-width: 520px;
}

.auth-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--auth-radius-md);
  background: var(--auth-accent-subtle);
  margin-bottom: 1.25rem;
  color: var(--auth-accent);
}

.auth-card__icon--success {
  background: rgba(16, 185, 129, 0.12);
  color: var(--auth-success);
}

.auth-card__icon--danger {
  background: rgba(244, 63, 94, 0.12);
  color: var(--auth-danger);
}

.auth-card__icon--warning {
  background: rgba(245, 158, 11, 0.12);
  color: var(--auth-warning);
}

.auth-card__title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--auth-text);
  margin-bottom: 0.5rem;
}

.auth-card__subtitle {
  font-size: 0.875rem;
  color: var(--auth-text-muted);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}


/* ── 6. Forms ─────────────────────────────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Extra breathing room before the primary CTA */
.auth-form .auth-btn--primary {
  margin-top: 0.5rem;
}

.auth-form label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--auth-text-muted);
  margin-bottom: 0.375rem;
}

.auth-form label .req-star {
  color: var(--auth-danger);
  margin-right: 2px;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="tel"],
.auth-form input[type="password"],
.auth-form select,
.auth-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--auth-bg-input);
  border: 1px solid var(--auth-stroke-hover);
  border-radius: var(--auth-radius-sm);
  color: var(--auth-text);
  font-family: inherit;
  font-size: 0.9375rem;
  transition: border-color var(--auth-duration) var(--auth-ease),
              box-shadow var(--auth-duration) var(--auth-ease);
  outline: none;
}

.auth-form input:focus,
.auth-form select:focus,
.auth-form textarea:focus {
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px var(--auth-accent-subtle);
}

.auth-form input:focus-visible,
.auth-form select:focus-visible,
.auth-form textarea:focus-visible {
  outline: none; /* custom ring above replaces default outline */
}

.auth-form input::placeholder {
  color: var(--auth-text-subtle);
}

/* Firefox autofill compat */
.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--auth-bg-input) inset;
  -webkit-text-fill-color: var(--auth-text);
  caret-color: var(--auth-text);
  transition: background-color 5000s ease-in-out 0s;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-row-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Phone-number: intl-tel-input integration */
.form-group--intl-phone .iti {
  width: 100%;
}

.form-group--intl-phone .iti__selected-dial-code {
  color: var(--auth-text);
}

/* Dropdown (may render outside parent in body) */
.iti__dropdown-content {
  background: #111113 !important;
  color: #f0f0f0 !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  border-radius: 8px !important;
}

.iti__country-list {
  background: #111113 !important;
}

.iti__country {
  color: #f0f0f0 !important;
}

.iti__country:hover,
.iti__country--highlight {
  background: rgba(255,255,255,0.08) !important;
}

.iti__search-input {
  background: #1a1a1d !important;
  color: #f0f0f0 !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 6px !important;
  padding: 0.5rem 0.75rem !important;
  font-family: inherit;
  font-size: 0.875rem;
  outline: none !important;
  caret-color: #f0f0f0;
}

.iti__search-input:focus {
  border-color: rgba(255,255,255,0.25) !important;
  box-shadow: none !important;
}

.iti__country-name,
.iti__dial-code {
  color: #f0f0f0 !important;
}

.iti__divider {
  border-bottom-color: rgba(255,255,255,0.10) !important;
}

.form-group--intl-phone .iti__arrow {
  border-top-color: var(--auth-text);
}

.form-group--intl-phone .iti__arrow--up {
  border-bottom-color: var(--auth-text);
}


/* ── 7. Buttons ───────────────────────────────────────── */
.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--auth-radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--auth-duration) var(--auth-ease);
  white-space: nowrap;
  text-decoration: none;
  width: 100%;
}

.auth-btn--primary {
  background: var(--auth-accent);
  color: #fff;
  box-shadow: 0 0 0 0 var(--auth-accent-glow);
}

.auth-btn--primary:hover {
  background: var(--auth-accent-hover);
  box-shadow: 0 0 24px var(--auth-accent-glow);
  transform: translateY(-1px);
}

.auth-btn--primary:focus-visible {
  outline: 2px solid var(--auth-accent-hover);
  outline-offset: 2px;
}

.auth-btn--primary:active {
  transform: translateY(0);
}

.auth-btn--ghost {
  background: transparent;
  color: var(--auth-accent);
  border: 1px solid var(--auth-stroke);
}

.auth-btn--ghost:hover {
  background: var(--auth-accent-subtle);
  border-color: var(--auth-accent);
}


/* ── 8. Alerts ────────────────────────────────────────── */
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--auth-radius-sm);
  font-size: 0.8125rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.auth-alert svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.auth-alert--error {
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.2);
  color: var(--auth-danger);
}

.auth-alert--success {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--auth-success);
}

.auth-alert--info {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--auth-accent-hover);
}

.auth-alert--warning {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--auth-warning);
}

.auth-alert strong {
  font-weight: 600;
}


/* ── 9. Field Errors ──────────────────────────────────── */
.auth-field-error {
  font-size: 0.75rem;
  color: var(--auth-danger);
  margin-top: 0.25rem;
}


/* ── 10. Password Strength ────────────────────────────── */
.pw-strength {
  margin-top: 0.375rem;
}

.pw-strength-track {
  position: relative;
  height: 6px;
  background: var(--auth-stroke);
  border-radius: 999px;
  overflow: hidden;
}

.pw-strength-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.35s ease, background 0.35s ease;
}

.pw-strength-label {
  font-size: 0.6875rem;
  color: var(--auth-text-subtle);
  margin-top: 0.25rem;
  text-align: right;
}

.hint-small {
  font-size: 0.75rem;
  color: var(--auth-text-subtle);
  line-height: 1.4;
  margin-top: 0.25rem;
}


/* ── 11. Checkbox ─────────────────────────────────────── */
.auth-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.25rem 0;
}

.auth-checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--auth-accent);
  flex-shrink: 0;
  cursor: pointer;
}

.auth-checkbox-row span,
.auth-checkbox-row label {
  font-size: 0.8125rem;
  color: var(--auth-text-muted);
  line-height: 1.4;
  cursor: pointer;
}

.auth-checkbox-row a {
  color: var(--auth-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-checkbox-row a:hover {
  color: var(--auth-accent-hover);
}


/* ── 12. Links & Footer Text ──────────────────────────── */
.auth-card__links {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--auth-text-muted);
}

.auth-card__links a {
  color: var(--auth-accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(99, 102, 241, 0.4);
  transition: color var(--auth-duration) var(--auth-ease),
              text-decoration-color var(--auth-duration) var(--auth-ease);
}

.auth-card__links a:hover {
  color: var(--auth-accent-hover);
  text-decoration-color: var(--auth-accent-hover);
}

.auth-card__links p {
  margin-top: 0.5rem;
}


/* ── 13. Right Panel ──────────────────────────────────── */

/* Mesh background orbs */
.auth-right::before,
.auth-right::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: auth-float 12s ease-in-out infinite alternate;
}

.auth-right::before {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #4f46e5, transparent 70%);
  top: -5%;
  right: -5%;
}

.auth-right::after {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, #06b6d4, transparent 70%);
  bottom: -10%;
  left: -10%;
  animation-delay: -6s;
}

.auth-right-orb-pink {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, #ec4899, transparent 70%);
  filter: blur(80px);
  opacity: 0.2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: auth-float 15s ease-in-out infinite alternate-reverse;
}

@keyframes auth-float {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, -20px) scale(1.08); }
}

.auth-right-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
}

.auth-right-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--auth-text);
  margin-bottom: 0.75rem;
}

.auth-right-content p {
  font-size: 0.9375rem;
  color: var(--auth-text-muted);
  line-height: 1.6;
}

/* 3D Scene container */
.auth-3d-scene {
  width: 440px;
  max-width: 100%;
  height: 260px;
  margin: 1.5rem auto 0;
  perspective: 900px;
}

.auth-3d-card {
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--auth-radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out;
  overflow: hidden;
  position: relative;
}

/* SVG Chart inside 3D card */
.auth-3d-card svg {
  width: 100%;
  height: 100%;
}

/* Floating particles on right */
.auth-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--auth-accent);
  opacity: 0.3;
  animation: auth-particle-drift linear infinite;
}

.auth-particle:nth-child(1) { width: 3px; height: 3px; top: 15%; left: 20%; animation-duration: 8s; opacity: 0.45; }
.auth-particle:nth-child(2) { width: 5px; height: 5px; top: 40%; left: 70%; animation-duration: 12s; animation-delay: -4s; opacity: 0.35; }
.auth-particle:nth-child(3) { width: 2px; height: 2px; top: 70%; left: 35%; animation-duration: 10s; animation-delay: -2s; opacity: 0.4; }
.auth-particle:nth-child(4) { width: 4px; height: 4px; top: 25%; left: 80%; animation-duration: 14s; animation-delay: -7s; opacity: 0.3; }
.auth-particle:nth-child(5) { width: 3px; height: 3px; top: 80%; left: 60%; animation-duration: 9s; animation-delay: -3s; opacity: 0.4; }
.auth-particle:nth-child(6) { width: 6px; height: 6px; top: 55%; left: 15%; animation-duration: 11s; animation-delay: -5s; opacity: 0.25; }

@keyframes auth-particle-drift {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  10%  { opacity: 0.3; }
  90%  { opacity: 0.3; }
  100% { transform: translateY(-60px) translateX(20px); opacity: 0; }
}


/* ── 14. Help Text (password reset confirm) ───────────── */
.auth-help-text {
  font-size: 0.6875rem;
  color: var(--auth-text-subtle);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.auth-help-text ul {
  padding-left: 1rem;
  list-style: disc;
}


/* ── 15. Responsive ───────────────────────────────────── */

/* Tablet */
@media (max-width: 1024px) {
  .auth-left {
    flex: 1 1 55%;
    max-width: 55%;
    padding: 1.5rem 2rem;
  }
  .auth-right {
    flex: 1 1 45%;
    max-width: 45%;
  }
  .auth-card {
    padding: 2rem;
  }
}

/* Mobile — hide right panel */
@media (max-width: 768px) {
  .auth-wrapper {
    flex-direction: column;
  }
  .auth-left {
    flex: 1 1 auto;
    max-width: 100%;
    padding: 1.5rem 1.25rem;
    min-height: 100vh;
    border-right: none;
  }
  .auth-right {
    display: none;
  }
  .auth-card {
    max-width: 100%;
    padding: 1.5rem;
    border: none;
    background: transparent;
    box-shadow: none;
  }
  .auth-card--wide {
    max-width: 100%;
  }
  .auth-card__title {
    font-size: 1.375rem;
  }
  .auth-footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .form-row-split {
    grid-template-columns: 1fr;
  }
  /* Prevent mobile auto-zoom on intl-tel-input */
  .form-group--intl-phone input[type="tel"],
  .iti__search-input {
    font-size: 16px !important;
  }
}

/* Small phones */
@media (max-width: 380px) {
  .auth-left {
    padding: 1rem;
  }
  .auth-card {
    padding: 1rem;
  }
  .auth-btn {
    font-size: 0.875rem;
    padding: 0.625rem 1.25rem;
  }
}
