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

:root {
  --bg: #2a0a08;
  --surface: rgba(255, 251, 245, 0.07);
  --border: rgba(255, 251, 245, 0.18);
  --border-focus: rgba(210, 80, 55, 0.70);
  --text: #fff5ee;
  --text-dim: rgba(255, 235, 210, 0.75);
  --text-dimmer: rgba(255, 251, 245, 0.35);
  --cherry: #8B1A10;
  --cherry-hover: #a82515;
  --error: rgba(230, 110, 85, 0.95);
  --success: rgba(160, 210, 140, 0.90);
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Cormorant Garamond", Georgia, serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(139, 0, 0, 0.07) 0%, transparent 70%),
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(80, 10, 5, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Nav ── */
.nav {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 36px;
  border-bottom: 1px solid rgba(255, 251, 245, 0.07);
}

.nav-logo {
  font-size: 22px;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}

.nav-link {
  font-size: 13px;
  font-style: italic;
  letter-spacing: 0.10em;
  color: var(--text-dimmer);
  text-decoration: none;
  transition: color 200ms ease;
}

.nav-link:hover { color: var(--text-dim); }

.nav-link-active {
  color: var(--text-dim);
  border-bottom: 1px solid rgba(255, 235, 210, 0.30);
  padding-bottom: 2px;
}

/* ── Page ── */
.page {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 70px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
}

/* ── Wordmark (index only) ── */
.wordmark {
  font-size: 52px;
  font-weight: 300;
  letter-spacing: 0.14em;
  color: var(--text);
  line-height: 1;
  margin-bottom: 8px;
  text-align: center;
}

.tagline {
  font-size: 13px;
  font-style: italic;
  font-weight: 300;
  letter-spacing: 0.20em;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 48px;
}

/* ── Card ── */
.card {
  width: 100%;
  max-width: 400px;
}

.card-wide {
  max-width: 520px;
}

.card-title {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text);
  margin-bottom: 32px;
  text-align: center;
}

/* ── Form elements ── */
form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-inline {
  flex-direction: row;
  gap: 10px;
  align-items: center;
}

.field-inline input {
  flex: 1;
}

label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 13px 15px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  outline: none;
  transition: border-color 200ms ease, background 200ms ease;
  -webkit-appearance: none;
  width: 100%;
}

input::placeholder { color: var(--text-dimmer); font-style: italic; }

input:focus {
  border-color: var(--border-focus);
  background: rgba(255, 251, 245, 0.09);
}

/* ── Messages ── */
.msg {
  font-size: 14px;
  font-style: italic;
  text-align: center;
  line-height: 1.5;
  min-height: 18px;
}

.msg.error  { color: var(--error); }
.msg.success { color: var(--success); }

/* ── Buttons ── */
.btn-primary, button[type="submit"]:not(.btn-secondary) {
  background: var(--cherry);
  border: 1px solid rgba(200, 70, 45, 0.40);
  border-radius: 4px;
  padding: 14px 0;
  font-family: inherit;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.10em;
  color: #fff5ee;
  cursor: pointer;
  transition: background 200ms ease, opacity 200ms ease;
  width: 100%;
}

.btn-primary:hover:not(:disabled),
button[type="submit"]:not(.btn-secondary):hover:not(:disabled) {
  background: var(--cherry-hover);
}

.btn-primary:disabled,
button[type="submit"]:disabled { opacity: 0.50; cursor: default; }

.btn-secondary {
  background: rgba(255, 251, 245, 0.07);
  border: 1px solid rgba(255, 251, 245, 0.18);
  border-radius: 4px;
  padding: 13px 20px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
  transition: background 200ms ease;
}

.btn-secondary:hover:not(:disabled) { background: rgba(255, 251, 245, 0.11); }
.btn-secondary:disabled { opacity: 0.50; cursor: default; }

/* ── Account page ── */
.account-header {
  margin-bottom: 28px;
  text-align: center;
}

.account-greeting {
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--text);
  margin-bottom: 6px;
}

.account-email {
  font-size: 14px;
  font-style: italic;
  color: var(--text-dimmer);
  letter-spacing: 0.08em;
}

.divider {
  height: 1px;
  background: rgba(255, 251, 245, 0.08);
  margin: 28px 0;
}

.account-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dimmer);
}

/* ── Footer hints ── */
.footer-hint {
  margin-top: 28px;
  font-size: 13px;
  font-style: italic;
  color: var(--text-dimmer);
  text-align: center;
}

.footer-hint a {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 235, 210, 0.25);
  padding-bottom: 1px;
  transition: color 200ms ease;
}

.footer-hint a:hover { color: var(--text); }

/* ── Success box (register page) ── */
.success-box { display: none; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.success-box.visible { display: flex; }
.success-icon { font-size: 28px; color: rgba(255, 200, 170, 0.6); }
.success-heading { font-size: 28px; font-weight: 500; color: var(--text); }
.success-body { font-size: 17px; font-style: italic; color: var(--text-dim); line-height: 1.7; max-width: 300px; }

@media (max-width: 480px) {
  .nav { padding: 18px 20px; }
  .wordmark { font-size: 38px; }
  .field-inline { flex-direction: column; }
  .field-inline .btn-secondary { width: 100%; }
}
