/* ── AUTH — The Grove Atelier by Moso ────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #F4F3F0;
  --surface:     #FDFCFA;
  --forest:      #1B3D2F;
  --forest-dim:  rgba(27,61,47,0.08);
  --border:      rgba(27,61,47,0.1);
  --border-em:   rgba(27,61,47,0.2);
  --gold:        #C5A059;
  --gold-dim:    rgba(197,160,89,0.28);
  --gold-faint:  rgba(197,160,89,0.1);
  --ink:         #1C1009;
  --ink-dim:     rgba(28,16,9,0.55);
  --ink-faint:   rgba(28,16,9,0.35);
  /* aliases preserved for any inline styles in HTML */
  --cream:       #F4F3F0;
  --cream-2:     rgba(28,16,9,0.55);
  --cream-3:     rgba(28,16,9,0.35);
  --black:       #1C1009;
  --panel:       #FDFCFA;
  --green:       #1B3D2F;
}

html, body {
  min-height: 100vh;
  font-family: 'Montserrat', sans-serif;
  background: var(--bg);
  color: var(--ink);
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1.5rem 1.5rem 3rem;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* The body is a centered flex column — force nav back to full-width and
   sticky so the auth page chrome matches every other page. */
body > nav {
  align-self: stretch;
  position: sticky;
  top: 0;
  margin: -1.5rem -1.5rem 0;
}

/* subtle warm background ornament */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 60% 40% at 80% 10%, rgba(197,160,89,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 20% 90%, rgba(27,61,47,0.05) 0%, transparent 60%);
  pointer-events: none;
}

/* ── TOP GOLD BAR ── */
.gold-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 99;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* ── AUTH CARD ── */
.auth-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border-em);
  box-shadow: 0 24px 64px rgba(28,16,9,0.08);
  padding: 2.8rem 2.4rem 2.4rem;
  margin-top: 2.5rem;
}
@media (max-width: 480px) {
  .auth-card { padding: 2.2rem 1.4rem 2rem; margin-top: 1.75rem; }
}

/* ── BRANDING ── */
.brand {
  text-align: center;
  margin-bottom: 2.2rem;
}
.brand-eyebrow {
  font-size: 0.62rem; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 0.5rem;
}
.brand-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem; font-weight: 300; font-style: italic; letter-spacing: 0.08em;
  color: var(--ink);
}
.brand-divider {
  width: 36px; height: 1px; background: var(--gold-dim);
  margin: 1rem auto 0;
}

/* ── VIEWS ── */
.view { display: none; }
.view.active { display: block; }

/* ── VIEW TITLE ── */
.view-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.55rem; font-weight: 300; font-style: italic; letter-spacing: 0.04em;
  color: var(--ink); text-align: center;
  margin-bottom: 0.4rem;
}
.view-subtitle {
  font-size: 0.82rem; color: var(--ink-dim); text-align: center;
  line-height: 1.7; margin-bottom: 2rem;
}

/* ── TABS ── */
.auth-tabs {
  display: flex; border-bottom: 1px solid var(--border-em);
  margin-bottom: 2rem;
}
.auth-tab {
  flex: 1; padding: 0.7rem; text-align: center;
  font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-faint); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
  background: none; border-left: none; border-right: none; border-top: none;
  font-family: 'Montserrat', sans-serif;
}
.auth-tab.active { color: var(--forest); border-bottom-color: var(--forest); }

/* ── FIELDS ── */
.field { margin-bottom: 1.1rem; position: relative; }
.field label {
  display: block; font-size: 0.62rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ink-faint);
  margin-bottom: 0.45rem;
}
.field input {
  width: 100%; padding: 0.8rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border-em);
  color: var(--ink); font-family: 'Montserrat', sans-serif; font-size: 0.9rem;
  outline: none; transition: border-color 0.2s, background 0.2s;
  -webkit-appearance: none;
}
.field input:focus {
  border-color: var(--forest);
  background: var(--surface);
}
.field input::placeholder { color: var(--ink-faint); font-size: 0.85rem; }

/* ── PASSWORD TOGGLE ── */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 2.8rem; }
.pw-toggle {
  position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 0.3rem;
  color: var(--ink-faint); font-size: 0.9rem; line-height: 1;
  transition: color 0.2s; user-select: none;
}
.pw-toggle:hover { color: var(--forest); }

/* ── PASSWORD STRENGTH ── */
.pw-strength-wrap { margin-top: 0.4rem; }
.pw-strength-bar {
  height: 2px; background: var(--border);
  overflow: hidden;
}
.pw-strength-fill {
  height: 100%; width: 0; transition: width 0.3s, background 0.3s;
}
.pw-strength-label {
  font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase;
  margin-top: 0.25rem; color: var(--ink-faint);
}

/* ── OTP BOXES ── */
.otp-grid {
  display: flex; gap: 0.55rem; justify-content: center;
  margin: 1.6rem 0;
}
.otp-box {
  width: 48px; height: 62px;
  background: var(--bg);
  border: 1px solid var(--border-em);
  color: var(--ink); font-family: 'Cormorant Garamond', serif;
  font-size: 1.7rem; font-weight: 400; text-align: center;
  outline: none; caret-color: var(--forest);
  transition: border-color 0.2s, background 0.2s;
  -webkit-appearance: none; border-radius: 0;
}
.otp-box:focus {
  border-color: var(--forest);
  background: var(--surface);
}
.otp-box.filled { border-color: var(--gold-dim); }
@media (max-width: 400px) {
  .otp-box { width: 40px; height: 52px; font-size: 1.4rem; }
  .otp-grid { gap: 0.4rem; }
}

/* ── BUTTONS ── */
.btn-primary {
  width: 100%; padding: 0.9rem;
  background: var(--forest); color: #fff;
  border: none; font-family: 'Montserrat', sans-serif;
  font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase;
  font-weight: 600; cursor: pointer; transition: background 0.2s, transform 0.1s;
}
.btn-primary:hover  { background: #14301f; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-ghost {
  width: 100%; padding: 0.75rem;
  background: transparent; color: var(--ink);
  border: 1px solid var(--border-em); font-family: 'Montserrat', sans-serif;
  font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase;
  cursor: pointer; transition: all 0.2s; margin-top: 0.6rem;
}
.btn-ghost:hover { border-color: var(--forest); color: var(--forest); }

/* ── SPINNER ── */
.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle; margin-right: 0.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; opacity: 0.5; } }

/* ── MESSAGES ── */
.msg {
  padding: 0.8rem 1rem; margin-bottom: 1.2rem;
  font-size: 0.82rem; line-height: 1.5;
}
.msg.error   { background: rgba(180,50,30,0.07); border-left: 3px solid rgba(180,50,30,0.4); color: rgba(160,40,20,0.9); }
.msg.success { background: var(--forest-dim);    border-left: 3px solid rgba(27,61,47,0.4);  color: var(--forest); }
.msg.info    { background: var(--gold-faint);    border-left: 3px solid var(--gold-dim);     color: var(--ink-dim); }

/* ── HELPER / FORGOT LINK ── */
.helper-row {
  display: flex; justify-content: flex-end; align-items: center;
  margin-top: 1rem;
}
.link-btn {
  background: none; border: none; cursor: pointer; font-family: 'Montserrat', sans-serif;
  font-size: 0.76rem; color: var(--ink-faint); letter-spacing: 0.04em;
  padding: 0; text-decoration: underline;
  transition: color 0.2s;
}
.link-btn:hover { color: var(--forest); }

/* ── STEP DOTS ── */
.step-dots {
  display: flex; justify-content: center; gap: 0.5rem;
  margin-bottom: 1.8rem;
}
.step-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--border-em); transition: background 0.3s;
}
.step-dot.active { background: var(--forest); }
.step-dot.done   { background: var(--gold-dim); }

/* ── SUCCESS RING ── */
.success-ring {
  width: 72px; height: 72px; border-radius: 50%;
  border: 1px solid var(--border-em);
  background: var(--forest-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: var(--forest);
  font-family: 'Cormorant Garamond', serif;
  margin: 0 auto 1.5rem;
}

/* ── USERNAME HINT ── */
.field-hint {
  font-size: 0.62rem; color: var(--ink-faint);
  margin-top: 0.3rem; letter-spacing: 0.04em;
}
.field-hint.ok  { color: var(--forest); }
.field-hint.bad { color: rgba(180,50,30,0.85); }

/* ── RESEND ROW ── */
.resend-row {
  text-align: center; margin-top: 1.2rem;
  font-size: 0.76rem; color: var(--ink-dim);
}

/* ── CARD FOOTER ── */
.card-footer {
  text-align: center; margin-top: 1.8rem;
  font-size: 0.62rem; letter-spacing: 0.08em;
  color: var(--ink-faint);
}

/* ── VIEW TRANSITION ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.view.active { animation: fadeIn 0.2s ease; }
@media (prefers-reduced-motion: reduce) {
  .view.active { animation: none; }
}

/* ── KEYBOARD FOCUS ── */
a:focus-visible, button:focus-visible, input:focus-visible,
.field input:focus-visible, .otp-box:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}
