/* ═══════════════════════════════════════════════════
   ScholarAI · seekX — Login
   2-zone layout: Left (brand + features) | Right (auth)
   ═══════════════════════════════════════════════════ */

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

:root {
  --bg:        #07070a;
  --surface:   #0e0e13;
  --surface2:  #15151c;
  --surface3:  #1c1c25;
  --border:    rgba(255,255,255,.06);
  --border2:   rgba(255,255,255,.10);
  --border3:   rgba(255,255,255,.16);
  --text:      #eae9e6;
  --text2:     #908f9a;
  --text3:     #5a5966;
  --accent:    #6ee7a0;
  --accent2:   #4ade80;
  --accent-dim:rgba(110,231,160,.06);
  --accent-glow:rgba(110,231,160,.14);
  --error:     #fb7185;
  --error-bg:  rgba(251,113,133,.08);
  --error-bd:  rgba(251,113,133,.18);
  --ok:        #6ee7a0;
  --ok-bg:     rgba(110,231,160,.08);
  --ok-bd:     rgba(110,231,160,.18);
  --warn:      #fbbf24;
  --warn-bg:   rgba(251,191,36,.08);
  --warn-bd:   rgba(251,191,36,.18);
  --serif:     'Cormorant Garamond', Georgia, serif;
  --sans:      'Outfit', system-ui, -apple-system, sans-serif;
  --mono:      'JetBrains Mono', 'Fira Code', monospace;
  --radius:    10px;
  --ease:      cubic-bezier(.4,0,.2,1);
  --ease-out:  cubic-bezier(.16,1,.3,1);
}

html { font-size: 16px; height: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  overflow: hidden;
}

/* ═══ Background ═══════════════════════════════════ */
#bgCanvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}
.bg-grad {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 1;
  background:
    radial-gradient(ellipse 60% 50% at 5% 50%, rgba(110,231,160,.045) 0%, transparent 60%),
    radial-gradient(ellipse 45% 60% at 50% 80%, rgba(74,222,128,.025) 0%, transparent 55%),
    radial-gradient(ellipse 40% 30% at 80% 15%, rgba(110,231,160,.02) 0%, transparent 50%);
  animation: gPulse 14s ease-in-out infinite alternate;
}
@keyframes gPulse { 0%{opacity:1} 50%{opacity:.4} 100%{opacity:1} }
.bg-noise {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 2; opacity: .014;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ═══ Two-Zone Layout ══════════════════════════════ */
.left-zone {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  position: relative;
  z-index: 3;
  min-width: 0;
  overflow-y: auto;
}

.left-inner {
  display: flex;
  gap: 3.5rem;
  max-width: 920px;
  width: 100%;
  align-items: flex-start;
}

.right-zone {
  width: 520px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem 3rem;
  background: var(--surface);
  border-left: 1px solid var(--border);
  position: relative;
  z-index: 3;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--surface3) transparent;
}

/* ═══ Brand Column (left side of left-zone) ════════ */
.brand-col {
  flex-shrink: 0;
  width: 380px;
  min-width: 300px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem .85rem;
  background: var(--accent-dim);
  border: 1px solid rgba(110,231,160,.12);
  border-radius: 100px;
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--accent);
  letter-spacing: .2em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
  width: fit-content;
}
.brand-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(110,231,160,.5);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

.logo {
  font-family: var(--serif);
  font-size: 4.5rem;
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1;
  margin-bottom: .45rem;
}
.logo em {
  font-style: italic;
  background: linear-gradient(135deg, var(--accent) 0%, #a7f3d0 50%, var(--accent) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 6s ease-in-out infinite;
}
@keyframes shimmer {
  0%,100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.logo-sub {
  font-size: .7rem;
  color: var(--text3);
  letter-spacing: .22em;
  text-transform: uppercase;
  font-weight: 400;
  margin-bottom: 2.8rem;
}

.tagline {
  font-family: var(--serif);
  font-size: 1.85rem;
  font-weight: 400;
  font-style: italic;
  color: var(--text2);
  line-height: 1.7;
  margin-bottom: 2.8rem;
}

.stats-row {
  display: flex;
  gap: 2.2rem;
  opacity: 0;
  animation: fadeIn .8s .7s ease forwards;
}
@keyframes fadeIn { to { opacity:1; } }
.stat-item { display: flex; flex-direction: column; gap: .12rem; }
.stat-num {
  font-family: var(--mono);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent);
}
.stat-label {
  font-size: .66rem;
  color: var(--text3);
  letter-spacing: .05em;
}

/* ═══ Features Column (right side of left-zone) ════ */
.feat-col {
  flex: 1;
  min-width: 0;
  padding-top: .5rem;
}

.feat-section-title {
  font-family: var(--mono);
  font-size: .64rem;
  color: var(--text3);
  letter-spacing: .3em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
  padding-left: 2px;
}

.feat-grid {
  display: flex;
  flex-direction: column;
  gap: .7rem;
  margin-bottom: 1.5rem;
}

.feat-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: rgba(14,14,19,.8);
  border: 1px solid var(--border);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(18px);
  animation: cardUp .55s var(--ease-out) forwards;
  transition: border-color .25s, background .25s, transform .25s, box-shadow .25s;
}
.feat-card:hover {
  border-color: rgba(110,231,160,.2);
  background: rgba(21,21,28,.95);
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.2), 0 0 0 1px rgba(110,231,160,.08);
}
@keyframes cardUp {
  to { opacity: 1; transform: translateY(0); }
}

.feat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--accent-dim);
  border: 1px solid rgba(110,231,160,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.05rem;
  line-height: 1;
}
.feat-body { min-width: 0; }
.feat-name {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .25rem;
}
.feat-desc {
  font-size: .78rem;
  color: var(--text3);
  line-height: 1.5;
}

/* Tech tags */
.tech-strip {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: 1.2rem;
  opacity: 0;
  animation: fadeIn .6s .8s ease forwards;
}
.tech-tag {
  padding: .28rem .7rem;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--text2);
  letter-spacing: .04em;
  transition: border-color .2s, color .2s;
}
.tech-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Trust line */
.trust-line {
  font-size: .74rem;
  color: var(--text3);
  line-height: 1.6;
  opacity: 0;
  animation: fadeIn .6s 1s ease forwards;
}
.trust-line strong {
  color: var(--text2);
  font-weight: 500;
}

/* ═══ Auth Panel ═══════════════════════════════════ */
.auth-wrap {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.tabs {
  display: flex;
  margin-bottom: 1.8rem;
  position: relative;
}
.tabs::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 1px; background: var(--border);
}
.tab {
  padding: .65rem 0;
  margin-right: 1.8rem;
  font-size: .88rem;
  font-weight: 500;
  color: var(--text3);
  cursor: pointer;
  border: none; background: none;
  border-bottom: 2px solid transparent;
  transition: all .25s;
  position: relative; z-index: 1;
  font-family: var(--sans);
}
.tab:hover { color: var(--text2); }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); }

/* Msg */
.msg-box {
  padding: .7rem 1rem;
  border-radius: var(--radius);
  font-size: .8rem;
  display: none;
  line-height: 1.5;
  margin-bottom: 1rem;
  animation: fadeSlide .3s ease;
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.msg-box.err  { display: block; background: var(--error-bg); border: 1px solid var(--error-bd); color: var(--error); }
.msg-box.ok   { display: block; background: var(--ok-bg); border: 1px solid var(--ok-bd); color: var(--ok); }
.msg-box.warn { display: block; background: var(--warn-bg); border: 1px solid var(--warn-bd); color: var(--warn); }

/* Forms */
.form {
  display: none;
  flex-direction: column;
  gap: 1.1rem;
}
.form.on {
  display: flex;
  animation: formIn .4s var(--ease-out);
}
@keyframes formIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Step panels - CRITICAL hide/show */
.step-panel {
  display: none !important;
  flex-direction: column;
  gap: 1.1rem;
}
.step-panel.active {
  display: flex !important;
  animation: stepIn .4s var(--ease-out);
}
@keyframes stepIn {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Step dots */
.steps {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: 1.3rem;
}
.step-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 600;
  border: 2px solid var(--border2);
  color: var(--text3);
  transition: all .35s var(--ease-out);
  flex-shrink: 0;
}
.step-dot.now {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 10px rgba(110,231,160,.12);
}
.step-dot.done {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
}
.step-line {
  flex: 1; height: 2px;
  background: var(--border);
  border-radius: 1px;
  transition: background .4s var(--ease-out);
}
.step-line.done { background: var(--accent); }

/* Fields */
.field { display: flex; flex-direction: column; gap: .4rem; }
.field label {
  font-size: .68rem; font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .1em;
}
.field input {
  padding: .75rem .95rem;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .88rem;
  font-family: var(--sans);
  outline: none;
  transition: border .2s, box-shadow .2s;
}
.field input::placeholder { color: var(--text3); font-size: .84rem; }
.field input:focus {
  border-color: rgba(110,231,160,.45);
  box-shadow: 0 0 0 3px rgba(110,231,160,.06);
}
.field-hint { font-size: .68rem; color: var(--text3); }

/* Buttons */
.btn {
  padding: .85rem;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  font-size: .92rem;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
  transition: all .2s;
  margin-top: .35rem;
}
.btn:hover {
  background: var(--accent2);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(110,231,160,.22);
}
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-link {
  background: none; border: none;
  color: var(--accent);
  font-size: .8rem;
  cursor: pointer;
  font-family: var(--sans);
  padding: 0;
  transition: color .2s;
}
.btn-link:hover { color: var(--accent2); text-decoration: underline; }
.btn-link:disabled { color: var(--text3); cursor: default; text-decoration: none; }

.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(8,8,11,.2);
  border-top-color: var(--bg);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle;
  margin-right: .4rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Code input */
.code-wrap {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: .6rem 0 .2rem;
}
.code-wrap input {
  width: 44px; height: 52px;
  text-align: center;
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 600;
  background: var(--bg);
  border: 1.5px solid var(--border2);
  border-radius: 8px;
  color: var(--text);
  outline: none;
  transition: all .2s;
  padding: 0;
}
.code-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(110,231,160,.08);
  transform: translateY(-2px);
}
.code-wrap input.filled {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.resend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .8rem;
}

/* PW strength */
.pw-strength { display: flex; gap: 3px; margin-top: .3rem; }
.pw-bar {
  flex: 1; height: 3px; border-radius: 2px;
  background: var(--border);
  transition: background .3s;
}
.pw-bar.weak   { background: var(--error); }
.pw-bar.medium { background: var(--warn); }
.pw-bar.strong { background: var(--accent); }

.row { display: flex; gap: .7rem; }
.row > * { flex: 1; min-width: 0; }

/* Success */
.success-icon {
  width: 60px; height: 60px;
  margin: 1.5rem auto 1rem;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  animation: popIn .5s var(--ease-out);
}
@keyframes popIn {
  0% { transform: scale(0); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
.success-icon svg {
  width: 28px; height: 28px;
  stroke: var(--bg); stroke-width: 3;
  stroke-linecap: round; stroke-linejoin: round;
  fill: none;
}
.success-icon svg path {
  stroke-dasharray: 36;
  stroke-dashoffset: 36;
  animation: tick .35s .35s ease forwards;
}
@keyframes tick { to { stroke-dashoffset: 0; } }
.success-title {
  text-align: center; font-size: 1.05rem; font-weight: 600;
  color: var(--text);
  opacity: 0; animation: fadeUp .4s .5s ease forwards;
}
.success-sub {
  text-align: center; font-size: .82rem;
  color: var(--text2);
  opacity: 0; animation: fadeUp .4s .65s ease forwards;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Footer */
.disclaimer {
  margin-top: 1.5rem;
  padding: .7rem .9rem;
  background: var(--warn-bg);
  border: 1px solid var(--warn-bd);
  border-radius: var(--radius);
  font-size: .72rem;
  color: var(--warn);
  text-align: center;
  line-height: 1.6;
}
.disclaimer strong { font-weight: 600; }
.foot {
  margin-top: 1.2rem;
  text-align: center;
  font-size: .72rem;
  color: var(--text3);
  line-height: 1.8;
}
.foot a { color: var(--accent); text-decoration: none; }
.foot a:hover { text-decoration: underline; }

/* ═══ Responsive ══════════════════════════════════ */
@media (max-width: 1400px) {
  .left-inner { gap: 2.5rem; }
  .brand-col { width: 340px; min-width: 280px; }
  .logo { font-size: 3.8rem; }
  .tagline { font-size: 1.6rem; }
  .right-zone { width: 480px; padding: 2.5rem 2.5rem; }
}
@media (max-width: 1200px) {
  .left-inner { flex-direction: column; gap: 2rem; max-width: 480px; }
  .brand-col { width: 100%; min-width: 0; }
  .feat-col { width: 100%; }
  .left-zone { padding: 2.5rem 2rem; }
}
@media (max-width: 900px) {
  body { flex-direction: column; overflow-y: auto; }
  .left-zone { flex: none; padding: 2.5rem 2rem; }
  .left-inner { flex-direction: column; gap: 1.5rem; max-width: 100%; }
  .feat-col { display: none; }
  .logo { font-size: 2.8rem; }
  .tagline { font-size: 1.2rem; margin-bottom: 1.5rem; }
  .stats-row { display: none; }
  .right-zone {
    width: 100%; flex: 1;
    padding: 2rem 1.5rem;
    border-left: none;
    border-top: 1px solid var(--border);
  }
}
@media (max-width: 480px) {
  .left-zone { padding: 2rem 1.5rem; }
  .logo { font-size: 2.2rem; }
  .tagline { font-size: 1rem; }
  .right-zone { padding: 1.5rem 1.2rem; }
  .row { flex-direction: column; }
  .code-wrap input { width: 38px; height: 46px; font-size: 1.1rem; }
}
