/* MarmaAI — Login / Sign up page
   Shares design tokens (--gold, --emerald, --shell-*, --card-*, fonts) with
   style.css/landing.css so it reads as the same product, not a bolted-on
   generic auth screen. */

html, body {
  height: auto;
  min-height: 100vh;
  overflow: visible;
}

.auth-root {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: var(--shell-bg);
}

/* ---------- Left: brand / story panel ---------- */
.auth-visual {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 48px;
  border-right: 1px solid var(--shell-border);
}
.auth-visual::before {
  content: "";
  position: absolute; inset: 0;
  background-image: url("/static/images/landing/hero-palm.jpg");
  background-size: cover; background-position: center;
  filter: saturate(0.9);
}
.auth-visual::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(14,18,16,0.55) 0%, rgba(14,18,16,0.35) 40%, rgba(14,18,16,0.92) 100%);
}
.auth-visual-content { position: relative; z-index: 2; }
.auth-visual-top { display: flex; align-items: center; gap: 12px; }
.auth-visual-top .brand-mark {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: radial-gradient(circle at 30% 30%, #D4AF37 0%, #B8941F 60%, #8B6F14 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(212,175,55,0.35), inset 0 -2px 4px rgba(0,0,0,0.3);
}
.auth-visual-top .brand-name {
  font-family: var(--font-display); font-size: 20px; font-weight: 500; color: #F5EFE3; letter-spacing: -0.01em;
}
.auth-visual-bottom { position: relative; z-index: 2; max-width: 420px; }
.auth-visual-bottom .eyebrow { color: var(--gold); margin-bottom: 14px; }
.auth-visual-bottom h2 {
  font-family: var(--font-display); font-size: clamp(24px, 3vw, 32px); font-weight: 500;
  color: #F5EFE3; line-height: 1.25; margin: 0 0 14px; letter-spacing: -0.01em;
}
.auth-visual-bottom h2 em { font-style: italic; font-family: var(--font-sans-alt); color: var(--gold); }
.auth-visual-bottom p {
  font-size: 14.5px; line-height: 1.65; color: rgba(232,225,208,0.78); margin: 0 0 22px;
}
.auth-visual-scope-list { display: flex; flex-direction: column; gap: 10px; }
.auth-visual-scope-list .row {
  display: flex; align-items: center; gap: 10px; font-size: 13px; color: rgba(232,225,208,0.85);
}
.auth-visual-scope-list .row svg { color: var(--gold); flex-shrink: 0; }
.auth-visual-back {
  position: relative; z-index: 2;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: rgba(232,225,208,0.75); text-decoration: none;
  font-family: var(--font-ui); width: fit-content;
}
.auth-visual-back:hover { color: #F5EFE3; }

/* ---------- Right: form panel ---------- */
.auth-panel {
  display: flex; align-items: center; justify-content: center;
  padding: 48px 40px;
  background: var(--shell-bg);
}
.auth-card {
  width: 100%; max-width: 400px;
}
.auth-card-head { margin-bottom: 28px; text-align: left; }
.auth-card-head .mobile-brand {
  display: none;
  align-items: center; gap: 10px; margin-bottom: 28px;
}
.auth-card-head .mobile-brand .brand-mark {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  background: radial-gradient(circle at 30% 30%, #D4AF37 0%, #B8941F 60%, #8B6F14 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(212,175,55,0.35);
}
.auth-card-head .mobile-brand .brand-name {
  font-family: var(--font-display); font-size: 18px; font-weight: 500; color: var(--shell-ink);
}
.auth-card-head h1 {
  font-family: var(--font-display); font-size: 28px; font-weight: 500;
  color: var(--shell-ink); margin: 0 0 8px; letter-spacing: -0.01em;
}
.auth-card-head p {
  font-size: 14px; color: var(--shell-ink-mute); margin: 0; line-height: 1.5;
}

.auth-tabs {
  display: inline-flex; padding: 3px; gap: 3px; margin-bottom: 26px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--shell-border);
  border-radius: 10px; width: 100%;
}
.auth-tab {
  flex: 1; border: none; background: transparent; cursor: pointer;
  font-family: var(--font-ui); font-size: 13.5px; font-weight: 500;
  padding: 9px 12px; border-radius: 7px; color: var(--shell-ink-mute);
  transition: all 160ms ease;
}
.auth-tab.on { background: rgba(212,175,55,0.16); color: var(--shell-ink); }

.auth-form { display: none; flex-direction: column; gap: 16px; }
.auth-form.active { display: flex; }

.auth-field { display: flex; flex-direction: column; gap: 7px; }
.auth-field label {
  font-family: var(--font-ui); font-size: 12.5px; font-weight: 500;
  color: var(--shell-ink-mute); letter-spacing: 0.01em;
}
.auth-input-wrap {
  position: relative; display: flex; align-items: center;
}
.auth-input-wrap svg {
  position: absolute; left: 13px; color: var(--shell-ink-faint); pointer-events: none;
}
.auth-input-wrap input {
  width: 100%; font-family: var(--font-ui); font-size: 14px; color: var(--shell-ink);
  background: rgba(255,255,255,0.03); border: 1px solid var(--shell-border);
  border-radius: 10px; padding: 11px 14px 11px 40px;
  transition: border-color 160ms ease, background 160ms ease;
}
.auth-input-wrap input::placeholder { color: var(--shell-ink-faint); }
.auth-input-wrap input:focus {
  outline: none; border-color: var(--gold); background: rgba(212,175,55,0.05);
}
.auth-input-wrap.has-toggle input { padding-right: 40px; }
.auth-input-toggle {
  position: absolute; right: 10px; background: none; border: none; cursor: pointer;
  color: var(--shell-ink-faint); padding: 4px; display: flex; align-items: center;
}
.auth-input-toggle:hover { color: var(--shell-ink-mute); }

.auth-field-hint {
  font-size: 11.5px; color: var(--shell-ink-faint); margin-top: -2px;
}

.auth-error {
  display: none; align-items: flex-start; gap: 10px;
  padding: 11px 14px; border-radius: 10px;
  background: rgba(239,68,68,0.10); border: 1px solid rgba(239,68,68,0.28);
  color: #F3A5A5; font-size: 13px; line-height: 1.5;
}
.auth-error.show { display: flex; }
.auth-error svg { flex-shrink: 0; margin-top: 1px; color: var(--state-unverified); }

.auth-success {
  display: none; align-items: flex-start; gap: 10px;
  padding: 11px 14px; border-radius: 10px;
  background: rgba(16,185,129,0.10); border: 1px solid rgba(16,185,129,0.28);
  color: #7BE0BF; font-size: 13px; line-height: 1.5;
}
.auth-success.show { display: flex; }
.auth-success svg { flex-shrink: 0; margin-top: 1px; color: var(--state-verified); }

.auth-submit {
  width: 100%; justify-content: center; font-size: 14.5px; padding: 12px 16px; margin-top: 4px;
}
.auth-submit[disabled] { opacity: 0.6; cursor: wait; }
.auth-submit .spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(26,29,32,0.25); border-top-color: #1A1D20;
  animation: authSpin 700ms linear infinite; display: none;
}
.auth-submit.loading .spinner { display: inline-block; }
.auth-submit.loading .submit-label { opacity: 0.7; }
@keyframes authSpin { to { transform: rotate(360deg); } }

.auth-switch {
  margin-top: 22px; text-align: center; font-size: 13.5px; color: var(--shell-ink-mute);
}
.auth-switch button {
  background: none; border: none; cursor: pointer; color: var(--gold);
  font-family: var(--font-ui); font-size: 13.5px; font-weight: 600; padding: 0; margin-left: 4px;
}
.auth-switch button:hover { text-decoration: underline; }

.auth-fine-print {
  margin-top: 24px; font-size: 11.5px; color: var(--shell-ink-faint); line-height: 1.6; text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .auth-root { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-card-head .mobile-brand { display: flex; }
  .auth-panel { padding: 32px 22px 48px; }
}
