/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design tokens ──────────────────────────────────────────── */
:root {
  --bg:           #F5F2ED;
  --surface:      #FFFAF5;
  --border:       #E8E3DC;
  --border-focus: #D4A574;
  --accent:       #D4A574;
  --accent-dark:  #B8875A;
  --text:         #2C2C2A;
  --text-muted:   #888780;
  --error:        #C0392B;
  --error-bg:     #FDF3F2;
  --error-border: #F5C6C2;
  --success:      #2E8B57;
  --radius:       8px;
  --shadow:       0 4px 24px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.05);
}

/* ── Base ───────────────────────────────────────────────────── */
html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ─────────────────────────────────────────────────── */
.page-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  background-color: var(--bg);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.75rem 2.25rem 2.25rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
  animation: rise .35s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Brand ──────────────────────────────────────────────────── */
.brand {
  margin-bottom: 2rem;
}
.wordmark {
  font-family: 'DM Serif Display', serif;
  font-size: 2rem;
  color: var(--accent);
  letter-spacing: -.02em;
  line-height: 1;
}
.brand-sub {
  font-size: .63rem;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--text-muted);
  margin-top: .25rem;
}

/* ── Form title ─────────────────────────────────────────────── */
.form-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 1.5rem;
}

/* ── Error box ──────────────────────────────────────────────── */
.error-box {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  margin-bottom: 1.25rem;
}
.error-msg {
  font-size: .78rem;
  color: var(--error);
  line-height: 1.5;
}
.error-msg + .error-msg { margin-top: .2rem; }

/* ── Form fields ────────────────────────────────────────────── */
.field { margin-bottom: 1.1rem; }

label {
  display: block;
  font-size: .67rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  margin-bottom: .4rem;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: .9rem;
  padding: .65rem .9rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}
input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(212,165,116,.18);
}

.field-hint {
  font-size: .63rem;
  color: var(--text-muted);
  margin-top: .35rem;
  line-height: 1.45;
}

/* ── Password strength bars ─────────────────────────────────── */
.strength-bars {
  display: flex;
  gap: .25rem;
  margin-top: .45rem;
}
.s-bar {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  transition: background .2s;
}
.s-bar.weak   { background: #C0392B; }
.s-bar.fair   { background: #E67E22; }
.s-bar.good   { background: var(--accent); }
.s-bar.strong { background: var(--success); }

/* ── Submit button ──────────────────────────────────────────── */
.btn-primary {
  display: block;
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: 'DM Mono', monospace;
  font-size: .8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: .82rem;
  margin-top: .75rem;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn-primary:hover  { background: var(--accent-dark); }
.btn-primary:active { transform: scale(.98); }

/* ── Form footer links ──────────────────────────────────────── */
.form-links {
  margin-top: 1.25rem;
  text-align: center;
  font-size: .7rem;
  color: var(--text-muted);
}
.form-links a {
  color: var(--accent-dark);
  text-decoration: none;
}
.form-links a:hover { text-decoration: underline; }
.link-sep  { margin: 0 .4rem; }
.link-muted { color: var(--text-muted) !important; }

/* ── App pill ───────────────────────────────────────────────── */
.app-pill {
  margin-top: 1.75rem;
  padding: .45rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: .63rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  text-align: center;
}
.app-pill strong { color: var(--accent-dark); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  .card { padding: 2rem 1.25rem 1.75rem; }
  .wordmark { font-size: 1.75rem; }
}
