/* "Digital Linen Closet" palette - same tokens as lib/app/theme/colors.dart */
:root {
  --bg: #FFF8F3;
  --surface: #FDF2E6;
  --surface-2: #FFFFFF;
  --text: #201B14;
  --muted: #444840;
  --border: #C5C8BD;
  --primary: #526047;
  --on-primary: #FFFFFF;
  --accent: #E8DCC5;
  --shadow: 0 18px 40px rgba(32, 27, 20, 0.12);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #181513;
    --surface: #262220;
    --surface-2: #342F2D;
    --text: #EDE6D8;
    --muted: #A79C8A;
    --border: #4A4033;
    --primary: #A3B08F;
    --on-primary: #181513;
    --accent: #D8B579;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); }
[hidden] { display: none !important; }

h1, h2, h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 16px;
  text-wrap: balance;
}
h1 { font-size: clamp(2.3rem, 5.5vw, 3.8rem); }
h1 em { font-style: italic; font-weight: 500; color: var(--primary); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 16px; }

.container { width: min(1120px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(720px, 100% - 32px); }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.lead { font-size: 1.125rem; color: var(--muted); max-width: 34em; }
.center .lead, .lead.center { margin-inline: auto; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-ghost { border-color: var(--border); color: var(--text); }
.btn-sm { padding: 9px 18px; font-size: 0.9rem; }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
}
.nav-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
}
.brand img { border-radius: 10px; }
.nav-links { display: flex; gap: 24px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.nav-links a:hover { color: var(--text); }

details {
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  padding: 18px 0;
}
summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; color: var(--primary); font-size: 1.3rem; line-height: 1; }
details[open] summary::after { content: '−'; }
details p { color: var(--muted); margin: 12px 0 0; }

.footer {
  border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  background: var(--surface);
  padding: 56px 0 28px;
  color: var(--muted);
  font-size: 0.92rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 32px;
}
.footer-brand p { margin-top: 14px; max-width: 26em; }
.footer-brand .brand { margin-right: 0; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h4 {
  margin: 0 0 4px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
}
.footer a { color: var(--muted); text-decoration: none; transition: color 0.15s ease; }
.footer a:hover { color: var(--text); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  font-size: 0.85rem;
}
/* Simple one-row footer on the legal pages */
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-inner nav { display: flex; gap: 20px; }

/* Auth hand-off panel */
.auth-forward {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 16px;
  gap: 8px;
  max-width: 480px;
  margin: 0 auto;
}
.auth-forward img { border-radius: 22px; margin-bottom: 12px; }
.auth-forward h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); }
.auth-forward p { color: var(--muted); }

/* Legal pages */
.legal { padding: 56px 0 88px; }
.legal h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.legal h2 { font-size: 1.4rem; margin-top: 36px; }
.legal p, .legal li { color: var(--muted); }
.legal ul { padding-left: 20px; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* Reset password page */
.auth-card {
  width: min(440px, 100% - 32px);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 0;
}
.auth-card .brand { margin: 0 0 32px; }
.auth-card h1 { font-size: clamp(1.7rem, 4vw, 2.2rem); }
.auth-card form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.auth-card label { font-weight: 600; font-size: 0.92rem; margin-top: 8px; }
.auth-card input {
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 16px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-card input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}
.auth-card .btn { margin-top: 16px; border: 0; cursor: pointer; font: inherit; font-weight: 600; }
.form-error { color: #BA1A1A; font-size: 0.9rem; margin: 4px 0 0; }
@media (prefers-color-scheme: dark) { .form-error { color: #FFB4AB; } }
