:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --ink: #16181d;
  --muted: #6b6f78;
  --line: #e6e1d8;
  --accent: #9a7b3f;
  --accent-ink: #7d6230;
  --dark: #14171c;
  --danger-bg: #fbeceb;
  --danger-ink: #8a2a22;
  --ok-bg: #ebf5ee;
  --ok-ink: #1f5a36;
  --radius: 12px;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Nav ---------- */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
}

.nav-brand {
  font-family: var(--serif);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  text-transform: capitalize;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.nav-brand::before {
  content: '';
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  border: 2px solid var(--accent);
  box-shadow: inset 0 0 0 2px var(--bg), inset 0 0 0 5px var(--accent);
}

.nav-links { display: flex; align-items: center; gap: 1.5rem; font-size: 0.95rem; }
.nav-links a { color: var(--ink); }
.nav-links .link-button { color: var(--muted); }
.nav-links .link-button:hover { color: var(--ink); }
.nav-links .nav-cta {
  background: var(--ink);
  color: #fff;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
}
.nav-links .nav-cta:hover { text-decoration: none; background: #2b2f38; }

/* ---------- Layout ---------- */
main {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem;
}

h1 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}
h2 { font-size: 1.05rem; margin: 0 0 1rem; }
p { line-height: 1.6; }

/* ---------- Hero ---------- */
.hero {
  background: var(--dark);
  color: #f1ece2;
  border-radius: 20px;
  padding: 5rem 3rem;
  margin-top: 0.5rem;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  right: -140px;
  top: 50%;
  width: 460px;
  height: 460px;
  transform: translateY(-50%);
  border-radius: 50%;
  border: 1px solid rgba(201, 169, 106, 0.35);
  box-shadow:
    inset 0 0 0 28px rgba(201, 169, 106, 0.05),
    inset 0 0 0 29px rgba(201, 169, 106, 0.3),
    inset 0 0 0 90px rgba(201, 169, 106, 0.04);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  color: #c9a96a;
  margin-bottom: 1.25rem;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.08;
  max-width: 14ch;
  margin-bottom: 1.25rem;
  color: #fff;
}
.hero .lede {
  max-width: 46ch;
  color: #b9b4a8;
  font-size: 1.1rem;
  margin-bottom: 2rem;
}
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.hero-actions .muted-link { color: #b9b4a8; }

.btn {
  display: inline-block;
  background: #c9a96a;
  color: #1a1710;
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
}
.btn:hover { background: #d8ba7d; text-decoration: none; }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.feature h3 { font-family: var(--serif); font-weight: 500; font-size: 1.15rem; margin-bottom: 0.4rem; }
.feature p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- Auth / forms ---------- */
.auth { display: flex; justify-content: center; align-items: flex-start; padding-top: 3vh; }

.form-container {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2.5rem 2.25rem;
  box-shadow: 0 1px 2px rgba(20, 23, 28, 0.04), 0 12px 32px -12px rgba(20, 23, 28, 0.12);
}
.form-container h1 { font-size: 1.9rem; margin-bottom: 1.5rem; }
.form-container .sub { color: var(--muted); margin: 0 0 1.75rem; font-size: 0.95rem; }
.form-container p { margin: 1.25rem 0 0; color: var(--muted); font-size: 0.93rem; text-align: center; }

.form-group { margin-bottom: 1.15rem; }
label { display: block; margin-bottom: 0.4rem; font-weight: 500; font-size: 0.88rem; }
small { display: block; margin-top: 0.35rem; color: var(--muted); font-size: 0.8rem; }

input[type='text'],
input[type='email'],
input[type='password'] {
  width: 100%;
  padding: 0.75rem 0.9rem;
  background: #fdfcfa;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:hover { border-color: #d3ccbf; }
input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(154, 123, 63, 0.2);
  background: #fff;
}

button {
  background: var(--ink);
  color: #fff;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s;
}
button:hover { background: #2b2f38; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.error-message, .notice-message {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
}
.error-message { background: var(--danger-bg); color: var(--danger-ink); }
.notice-message { background: var(--ok-bg); color: var(--ok-ink); }

/* ---------- Dashboard ---------- */
.user-card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1.5rem;
  border-radius: var(--radius);
  margin: 1.5rem 0;
  max-width: 560px;
}
dl { display: grid; grid-template-columns: 130px 1fr; gap: 0.85rem; }
dt { color: var(--muted); font-size: 0.9rem; }
dd { font-weight: 500; }

/* Buttons rendered as links (logout must be a POST) */
.link-button {
  background: none; border: 0; padding: 0; width: auto;
  color: inherit; font: inherit; font-weight: 400; cursor: pointer;
}
.link-button:hover { background: none; }
main > form .link-button { text-decoration: underline; color: var(--muted); }

.inline-form { display: inline; }
[hidden] { display: none !important; }

@media (max-width: 600px) {
  .hero { padding: 3rem 1.5rem; }
  .hero::after { display: none; }
  .form-container { padding: 2rem 1.5rem; }
}
