/* static-frontend/public/styles/auth-pages.css — login/signup split layout (landing hero + form) */

:root {
  --bg: #072E3E;
  --surface: #083345;
  --accent: #7BFF00;
  --text: #ffffff;
  --muted: #AEAEC9;
  --border: rgba(174, 174, 201, 0.12);
  --bg-deep: #052532;
  --surface-2: #0a3c52;
  --accent-soft: rgba(123, 255, 0, 0.12);
  --accent-line: rgba(123, 255, 0, 0.35);
  --text-dim: rgba(255, 255, 255, 0.72);
  --font-display: 'Montserrat', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Noto Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body.auth-page {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ============================================================================
   SPLIT LAYOUT — form (LHS) | divider | hero (RHS)
   Canvas/animation are clipped to .auth-hero only.
   ========================================================================== */
.auth-layout {
  display: grid;
  grid-template-columns: minmax(360px, 460px) 1px minmax(0, 1fr);
  min-height: 100vh;
  width: 100%;
}

/* Landing-style brand: pinned to top-left of the form column / screen. */
.auth-top-brand {
  position: absolute;
  top: clamp(1.15rem, 2.8vh, 1.65rem);
  left: clamp(1.15rem, 2.8vw, 2rem);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
}

.auth-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  min-height: 100vh;
}

.auth-hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

.auth-hero__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 80% 10%, rgba(123, 255, 0, 0.10), transparent 55%),
    linear-gradient(180deg, rgba(7, 46, 62, 0.35) 0%, rgba(7, 46, 62, 0.55) 45%, var(--bg) 100%);
}

.auth-hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 980px;
  padding: clamp(1.5rem, 4vh, 2.75rem) clamp(1.5rem, 4vw, 2.75rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.25rem);
}

.auth-hero .hero__card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  text-align: left;
  flex: 1 1 280px;
  max-width: 480px;
  min-width: min(100%, 260px);
  background: linear-gradient(165deg, var(--surface-2), var(--surface));
  border: 1px solid var(--accent-line);
  border-radius: calc(var(--radius) * 1.5);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  box-shadow: 0 50px 120px -50px rgba(123, 255, 0, 0.3);
}

.auth-hero .hero__card > *:not(.hero__watermark) {
  position: relative;
  z-index: 1;
}

.auth-hero .hero__watermark {
  position: absolute;
  z-index: 0;
  right: -58px;
  bottom: -76px;
  width: clamp(160px, 24vw, 260px);
  height: clamp(160px, 24vw, 260px);
  color: var(--accent);
  opacity: 0.07;
  pointer-events: none;
}

.auth-hero .hero__watermark .logo {
  width: 100%;
  height: 100%;
  display: block;
}

.auth-hero .hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.auth-hero .hero__eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.auth-hero .hero__eyebrow-beta {
  color: var(--accent);
  background: rgba(123, 255, 0, 0.14);
  padding: 0.15em 0.45em;
  border-radius: 4px;
  letter-spacing: 0.14em;
}

.auth-hero .hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-size: clamp(1.7rem, 2.8vw, 2.45rem);
  margin-bottom: 1rem;
}

.auth-hero .hero__title .brand__labs {
  color: var(--accent);
}

.auth-hero .hero__title .dotmark {
  color: var(--accent);
}

.auth-hero .hero__sub {
  max-width: 40ch;
  margin: 0;
  font-size: clamp(0.95rem, 1.15vw, 1.08rem);
  color: var(--text-dim);
}

/* Dummy AI chat-composer mock (decorative) */
.auth-hero .hero__prompt {
  flex: 1 1 260px;
  min-width: min(100%, 240px);
  max-width: 420px;
}

.auth-hero .hero-prompt {
  display: flex;
  flex-direction: column;
  gap: clamp(0.85rem, 1.8vw, 1.2rem);
  width: 100%;
  padding: clamp(1rem, 2vw, 1.35rem);
  background: var(--surface);
  border: 1px solid rgba(174, 174, 201, 0.18);
  border-radius: clamp(18px, 2.8vw, 28px);
  box-shadow:
    0 24px 60px -36px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.auth-hero .hero-prompt__text {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(0.88rem, 1.05vw, 0.98rem);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
  min-height: 5.8em;
}

.auth-hero .hero-prompt__typed {
  white-space: pre-wrap;
}

.auth-hero .hero-prompt__caret {
  display: inline-block;
  margin-left: 1px;
  color: var(--accent);
  animation: authPromptCaret 1s step-end infinite;
}

@keyframes authPromptCaret {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.auth-hero .hero-prompt__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.auth-hero .hero-prompt__tools {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.auth-hero .hero-prompt__add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(174, 174, 201, 0.16);
}

.auth-hero .hero-prompt__model {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.auth-hero .hero-prompt__model-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.auth-hero .hero-prompt__chevron {
  color: var(--muted);
  opacity: 0.85;
}

.auth-hero .hero-prompt__send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f2f4f5;
  color: #06222d;
  box-shadow: 0 8px 22px -12px rgba(123, 255, 0, 0.45);
}

/* Vertical hairline between form and hero (desktop only) */
.auth-divider {
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    var(--accent-line) 18%,
    rgba(174, 174, 201, 0.22) 50%,
    var(--accent-line) 82%,
    transparent 100%
  );
  box-shadow: 0 0 18px rgba(123, 255, 0, 0.12);
}

/* ============================================================================
   FORM PANEL
   ========================================================================== */
.auth-panel {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-deep);
  padding: clamp(1.5rem, 4vh, 2.5rem) clamp(1.25rem, 3vw, 2.25rem);
  min-height: 100vh;
  overflow-y: auto;
}

.auth-form-box {
  width: 100%;
  max-width: 380px;
  animation: authFadeIn 0.45s var(--ease);
}

@keyframes authFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.auth-top-brand__logo {
  width: 34px;
  height: 34px;
  color: var(--accent);
  flex: 0 0 auto;
}

.auth-top-brand__logo svg {
  width: 100%;
  height: 100%;
  display: block;
}

.auth-top-brand__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.auth-top-brand__labs {
  color: var(--accent);
}

.auth-form-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  margin-bottom: 1.75rem;
  color: var(--text);
}

.auth-form-group {
  margin-bottom: 0.95rem;
}

.auth-form-group label {
  display: block;
  margin-bottom: 0.45rem;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* Screen-reader-only field labels when placeholders carry the visible hint. */
.auth-form-group label.auth-label-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-turnstile-wrap {
  display: flex;
  justify-content: center;
}

.auth-form-group input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

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

.auth-password-wrap input {
  padding-right: 2.85rem;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.auth-password-toggle:hover:not(:disabled) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.auth-password-toggle:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.auth-password-toggle__icon--hide {
  display: none;
}

.auth-password-toggle.is-visible .auth-password-toggle__icon--show {
  display: none;
}

.auth-password-toggle.is-visible .auth-password-toggle__icon--hide {
  display: block;
}

.auth-form-group input::placeholder {
  color: rgba(174, 174, 201, 0.55);
}

.auth-form-group input:focus {
  outline: none;
  border-color: var(--accent-line);
  background: rgba(123, 255, 0, 0.04);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.auth-error {
  color: #ff8a8a;
  margin-bottom: 1rem;
  min-height: 0;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0;
  background: transparent;
  border: none;
  display: none;
}

.auth-error:not(:empty) {
  display: block;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 107, 107, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(255, 107, 107, 0.22);
  margin-bottom: 1rem;
}

.auth-submit {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.95rem 1.25rem;
  background: var(--accent);
  color: #06222d;
  border: none;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 8px 30px -10px rgba(123, 255, 0, 0.5);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.auth-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px -10px rgba(123, 255, 0, 0.6);
}

.auth-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.auth-footer-links {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}

.auth-footer-links a {
  color: var(--text-dim);
  transition: color 0.2s var(--ease);
}

.auth-footer-links a:hover {
  color: var(--accent);
}

/* Plan picker (signup) */
.plan-picker-group {
  margin-bottom: 1.15rem;
}

.plan-cards {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.45rem;
}

.plan-card {
  display: block;
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.plan-card:hover {
  border-color: var(--accent-line);
  background: rgba(123, 255, 0, 0.04);
}

.plan-card.selected {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px rgba(123, 255, 0, 0.15);
}

.plan-card-name {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.plan-card-tagline {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim, rgba(255, 255, 255, 0.72));
  margin-bottom: 0.25rem;
}

.plan-card-price {
  display: block;
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.plan-card-desc {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ============================================================================
   MOBILE — form only (hide hero + divider)
   ========================================================================== */
@media (max-width: 899px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-hero,
  .auth-divider {
    display: none !important;
  }

  .auth-panel {
    min-height: 100vh;
    background: var(--bg);
  }
}
