/* 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: radial-gradient(circle at 72% 18%, rgba(212,175,55,.08), transparent 30%), 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(1.12) contrast(1.06);
}
.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 { padding: 22px 24px; border: 1px solid rgba(232,225,208,.16); border-radius: 18px; background: rgba(14,18,16,.46); backdrop-filter: blur(8px); box-shadow: 0 18px 50px rgba(0,0,0,.18); }
.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 {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: 48px 40px;
  background: var(--shell-bg);
  overflow: hidden;
}
.auth-panel::before { content: ""; position: absolute; width: 360px; height: 360px; top: 8%; right: 8%; border-radius: 50%; background: radial-gradient(circle, rgba(212,175,55,.08), transparent 68%); pointer-events: none; }
.auth-card {
  position: relative; z-index: 1; width: 100%; max-width: 430px;
}
.auth-card-head { margin-bottom: 28px; text-align: left; }
.mobile-brand.auth-card-head {
  display: none;
  align-items: center; gap: 10px; margin-bottom: 28px;
}
.mobile-brand.auth-card-head .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);
}
.mobile-brand.auth-card-head .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: 34px; 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.045); 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-tabs[hidden], .auth-switch[hidden] { display: none; }

.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: 14px; 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;
  min-height: 46px;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.auth-root .auth-input-wrap input { padding: 11px 44px 11px 42px; }
.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); box-shadow: 0 0 0 3px rgba(212,175,55,.12);
}
.auth-input-wrap.has-toggle input { padding-right: 40px; }
.auth-root .auth-input-wrap input[aria-invalid="true"] { border-color: var(--state-unverified); }
.auth-input-toggle {
  position: absolute; right: 2px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer;
  color: var(--shell-ink-mute); width: 42px; height: 42px; padding: 0; display: flex; align-items: center; justify-content: center;
}
.auth-input-toggle:hover { color: var(--shell-ink-mute); }

.auth-field-hint {
  font-size: 12.5px; color: var(--shell-ink-mute); margin-top: -2px;
}
.auth-field-hint::before { content: "• "; color: var(--gold); }
.auth-tab[aria-selected="true"] { box-shadow: 0 4px 14px rgba(212,175,55,.12); }
.auth-submit { min-height: 48px; font-weight: 600; letter-spacing: .01em; }

.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-inline-error { display: block; margin-top: 6px; color: #F3A5A5; font-size: 12.5px; line-height: 1.45; }
.card-paper .auth-inline-error { color: #9F2525; }

.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(--accent-text);
  font-family: var(--font-ui); font-size: 13.5px; font-weight: 600; padding: 8px 4px; margin-left: 4px;
  min-height: 40px;
}
.auth-switch button:hover { text-decoration: underline; }

.auth-fine-print {
  margin-top: 24px; font-size: 12.5px; color: var(--shell-ink-mute); line-height: 1.6; text-align: center;
}
.auth-root [data-auth-action="forgot"] { color: var(--accent-text) !important; display: inline-flex; align-items: center; min-height: 40px; padding: 8px 2px; }
.auth-noscript { padding: 12px 14px; border: 1px solid var(--shell-border); border-radius: 10px; color: var(--shell-ink); font-size: 14px; line-height: 1.5; }
.auth-mobile-back { display: none; }

/* ---------- In-app auth (renders inside a parchment card) ----------
   The standalone /login page draws the form directly on the dark shell,
   so the rules above use --shell-ink. Inside the app the same classes sit
   in a .card-paper card and must use the --card-ink family instead. */
.card-paper .auth-field label { color: var(--card-ink-mute); }
.card-paper .auth-input-wrap > svg { color: var(--card-ink-faint); }
.card-paper .auth-input-wrap input {
  color: var(--card-ink);
  background: var(--card-bg-2);
  border-color: var(--card-border);
}
.card-paper .auth-input-wrap input::placeholder { color: var(--card-ink-faint); }
.card-paper .auth-input-wrap input:focus {
  border-color: var(--gold); background: rgba(212,175,55,0.10);
}
.card-paper .auth-input-toggle { color: var(--card-ink-faint); }
.card-paper .auth-input-toggle:hover { color: var(--card-ink-mute); }
.card-paper .auth-field-hint { color: var(--card-ink-faint); }
.card-paper .auth-switch { color: var(--card-ink-mute); }
.card-paper .auth-fine-print { color: var(--card-ink-faint); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .auth-root { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .mobile-brand.auth-card-head { display: flex; margin-bottom: 18px; }
  .auth-panel { align-items: flex-start; padding: 32px 22px 48px; }
  .auth-mobile-back { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 10px 2px; margin: 0 0 18px; color: var(--shell-ink-mute); text-decoration: none; font-size: 13px; }
}

/* ---- Improved mobile auth page ---- */
@media (max-width: 860px) {
  .auth-panel { padding: 28px 20px 40px; }
  .auth-card { max-width: 100%; }
}
@media (max-width: 480px) {
  .auth-panel { padding: 24px 16px 36px; }
  .auth-card-head h1 { font-size: 30px; }
  .auth-tabs { margin-bottom: 20px; }
  .auth-tab { font-size: 13px; padding: 8px 10px; }
  .auth-submit { font-size: 14px; padding: 11px 14px; }
}

@media (max-width: 860px) {
  .auth-root { background: radial-gradient(circle at 50% 0%, rgba(212,175,55,.10), transparent 36%), var(--shell-bg); }
  .auth-panel::before { width: 260px; height: 260px; top: 0; right: 0; }
}

/* Shared original mark: no legacy gold tile behind the Android identity. */
.auth-visual-top .brand-mark,.mobile-brand.auth-card-head .brand-mark{width:44px;height:44px;background:transparent;box-shadow:none;border-radius:50%}
.brand-mark img{display:block;width:100%;height:100%;object-fit:contain}
