/* Slow News — web styles */
/* Font: Courier New monospace, matching the digest aesthetic */

:root {
  --font: 'Courier New', Courier, 'Lucida Console', monospace;
  --bg: #f9f6f0;
  --surface: #ffffff;
  --border: #e0d9ce;
  --text: #1a1a1a;
  --muted: #666;
  --accent: #2c5f8a;
  --accent-hover: #1e4464;
  --gold: #b8955a;
  --error-bg: #fdf3f3;
  --error-border: #e8a8a8;
  --error-text: #7a2020;
  --success-bg: #f3fdf5;
  --success-border: #a8d8b0;
  --success-text: #1a5c28;
  --info-bg: #f3f7fd;
  --info-border: #a8bfd8;
  --info-text: #1a3a5c;
}

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

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: underline; }
a:hover { color: var(--accent-hover); }

/* ── Nav ──────────────────────────────────────────────────────────────────── */

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  text-decoration: none;
  display: flex;
  align-items: center;
}

.nav-logo-img {
  height: 32px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
}

.nav-links a { text-decoration: none; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn-primary {
  background: var(--text);
  color: #fff;
  border: none;
  padding: 10px 20px;
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  border-radius: 2px;
}

.btn-primary:hover { background: #333; color: #fff; }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 20px;
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  border-radius: 2px;
}

.btn-secondary:hover { border-color: var(--text); }

.btn-disabled {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 10px 20px;
  font-family: var(--font);
  font-size: 14px;
  display: inline-block;
  border-radius: 2px;
  cursor: default;
}

.btn-lg { padding: 13px 28px; font-size: 15px; }
.btn-full { width: 100%; text-align: center; padding: 12px; font-size: 15px; }

/* ── Flash messages ───────────────────────────────────────────────────────── */

.flash {
  max-width: 860px;
  margin: 16px auto;
  padding: 12px 16px;
  font-size: 14px;
  border-radius: 2px;
  border-left: 3px solid;
}

.flash-error   { background: var(--error-bg);   border-color: var(--error-border);   color: var(--error-text); }
.flash-success { background: var(--success-bg); border-color: var(--success-border); color: var(--success-text); }
.flash-info    { background: var(--info-bg);    border-color: var(--info-border);    color: var(--info-text); }

/* ── Main content ─────────────────────────────────────────────────────────── */

main {
  flex: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 24px;
  width: 100%;
}

/* ── Hero (landing page) ──────────────────────────────────────────────────── */

.hero {
  text-align: center;
  padding: 60px 0 48px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}

.hero h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.hero-sub {
  max-width: 520px;
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

/* ── Tier cards ───────────────────────────────────────────────────────────── */

.tiers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

.tier {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 28px 24px;
}

.tier-paid {
  border-color: var(--gold);
}

.tier h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.tier-price {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}

.tier ul {
  list-style: none;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 2;
}

.tier ul li::before { content: "— "; color: var(--muted); }

/* ── Forms ────────────────────────────────────────────────────────────────── */

.form-page {
  max-width: 420px;
  margin: 0 auto;
}

.form-page h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
}

.form-desc {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
  margin-top: -16px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form label {
  font-size: 13px;
  font-weight: 700;
  margin-top: 16px;
  margin-bottom: 4px;
  display: block;
}

.form input[type="email"],
.form input[type="password"],
.form input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--font);
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.form input:focus { border-color: var(--accent); }

.form .btn-primary { margin-top: 20px; }

.form-row-end {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.link-subtle {
  font-size: 13px;
  color: var(--muted);
}

.form-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--muted);
}

/* ── Dashboard ────────────────────────────────────────────────────────────── */

.dashboard-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.dashboard-header h1 { font-size: 24px; margin-bottom: 4px; }

.dashboard-email { font-size: 14px; color: var(--muted); }

.dashboard-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 24px;
}

.card h2 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #888;
  margin-bottom: 16px;
}

.card p { font-size: 14px; line-height: 1.75; margin-bottom: 8px; }

.tier-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 2px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tier-badge.tier-free { background: var(--bg); border: 1px solid var(--border); color: var(--muted); }
.tier-badge.tier-paid { background: #fdf8ef; border: 1px solid var(--gold); color: #7a5a20; }

.coming-soon {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

/* ── Digest history ───────────────────────────────────────────────────────── */

.digest-history {
  margin-top: 40px;
}

.digest-history h2 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #888;
  margin-bottom: 16px;
}

.digest-list {
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  overflow: hidden;
}

.digest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.digest-item:last-child { border-bottom: none; }

.digest-item a { text-decoration: none; font-weight: 700; }
.digest-item a:hover { text-decoration: underline; }

.digest-meta {
  font-size: 12px;
  color: var(--muted);
  text-transform: capitalize;
}

.muted-text { font-size: 13px; color: var(--muted); }

/* ── Profile page ─────────────────────────────────────────────────────────── */

.profile-page { max-width: 540px; }

.form-select {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--font);
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

.form-select:focus { border-color: var(--accent); }

.form input[type="number"] {
  width: 100px;
  padding: 10px 12px;
  font-family: var(--font);
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.form input[type="number"]:focus { border-color: var(--accent); }

.field-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  margin-bottom: 0;
}

.label-hint {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.checkbox-row input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.form .checkbox-row label,
.form .checkbox-row .checkbox-label {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  display: inline;
  cursor: pointer;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  margin-top: 12px;
  display: inline-block;
}

/* ── Upgrade banner + locked profile ──────────────────────────────────────── */

.upgrade-banner {
  background: #fdf8ef;
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 14px;
}

.upgrade-banner p { margin-bottom: 0; }

.profile-form-wrap { position: relative; }

.profile-form-locked {
  opacity: 0.45;
  pointer-events: none;
  user-select: none;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
