/* ============================================================
   GalleyForge design system
   Palette: pulled directly from the logo -- deep navy (#001F50) as
   the primary ink color, vivid blue (#003F98) as a secondary accent,
   and warm orange (#F5820A) as the highlight/CTA color.
   ============================================================ */

:root {
  --ink: #0C2A5E;
  --ink-soft: #1554A8;
  --blue-accent: #003F98;
  --paper: #FBFAF6;
  --paper-dim: #F1EEE5;
  --line: #E4DFD1;
  --gold: #F5820A;
  --gold-soft: #FDEBD3;
  --text: #26293B;
  --text-muted: #666B7D;
  --success: #2F7D5C;
  --success-bg: #E4F3EC;
  --error: #B23A32;
  --error-bg: #FBEAE8;
  --info: #2E5C8A;
  --info-bg: #E7F0FA;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(12, 42, 94, 0.08), 0 8px 24px rgba(12, 42, 94, 0.06);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 0.5em;
}

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

img { max-width: 100%; display: block; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------------------------------------------------- header --- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
}
.brand-logo {
  height: 36px;
  width: auto;
  display: block;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14.5px;
}
.nav-links a { color: var(--ink-soft); font-weight: 500; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-credits {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--gold-soft);
  color: var(--ink);
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
}
/* FIX: ".nav-links a" (class+tag = specificity 0,1,1) was beating
   ".btn-primary" (single class = specificity 0,1,0) regardless of which
   rule came later in the file, so the "Log in" button's text rendered in
   --ink-soft (a medium navy) instead of --paper (near-white) against its
   own dark --ink background -- barely readable. ".nav-links a.nav-cta"
   matches specificity (0,2,1 vs 0,1,1) and wins outright. */
.nav-links a.nav-cta,
.nav-links a.nav-cta:hover {
  color: var(--paper);
  text-decoration: none;
}

/* ----------------------------------------------------------- buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 7px;
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.06s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--ink-soft); }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: #96650f; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--paper); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-danger { background: var(--error); color: #fff; }
.btn-block { width: 100%; }

/* ------------------------------------------------------------- hero --- */
.hero {
  padding: 88px 0 72px;
  border-bottom: 1px solid var(--line);
}
.hero .eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
  font-weight: 600;
}
.hero h1 {
  font-size: 52px;
  max-width: 780px;
  margin-bottom: 20px;
}
.hero p.lede {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 32px;
}
.hero-actions { display: flex; gap: 14px; }

/* ---------------------------------------------------------- sections --- */
.section { padding: 72px 0; }
.section-tight { padding: 48px 0; }
.section-head { max-width: 620px; margin-bottom: 40px; }
.section-head .eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 10px;
  display: block;
}
.section-alt { background: var(--paper-dim); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

.feature {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}
.feature .num { font-family: var(--mono); color: var(--gold); font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.feature h3 { font-size: 18px; margin-bottom: 8px; }
.feature p { color: var(--text-muted); font-size: 14.5px; margin: 0; }

/* -------------------------------------------------------- template cards --- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.tpl-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.12s ease;
}
.tpl-card:hover { transform: translateY(-3px); }
.tpl-thumb {
  height: 130px;
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-soft) 100%);
  color: var(--gold-soft);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-size: 15px;
  text-align: center;
  padding: 16px;
}
.tpl-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.tpl-body h3 { font-size: 17px; margin: 0; }
.tpl-body p { font-size: 13.5px; color: var(--text-muted); margin: 0; flex: 1; }
.tpl-meta { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--text-muted); }
.badge {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  background: var(--gold-soft);
  color: var(--gold);
  padding: 3px 9px;
  border-radius: 20px;
}

/* --------------------------------------------------------------- forms --- */
.auth-shell {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px;
}
.card-narrow { max-width: 420px; width: 100%; }
.card h2 { font-size: 24px; margin-bottom: 6px; }
.card .subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 26px; }

label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 16px 0 6px;
}
label:first-of-type { margin-top: 0; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=file], input[type=tel], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-family: var(--sans);
  font-size: 14.5px;
  background: #fff;
  color: var(--text);
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--gold);
}
textarea { resize: vertical; min-height: 70px; }
.field-hint { font-size: 12.5px; color: var(--text-muted); margin-top: 5px; }
.field-row { display: flex; gap: 14px; }
.field-row > div { flex: 1; }

/* -------------------------------------------------------------- flash --- */
.flash-list { max-width: 1120px; margin: 18px auto 0; padding: 0 24px; display: flex; flex-direction: column; gap: 10px; }
.flash {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  border: 1px solid transparent;
}
.flash-success { background: var(--success-bg); color: var(--success); border-color: #cfe9dd; }
.flash-error { background: var(--error-bg); color: var(--error); border-color: #f1cdc9; }
.flash-info { background: var(--info-bg); color: var(--info); border-color: #cfe0f1; }
.flash-warning { background: var(--gold-soft); color: #7a5311; border-color: #ecd8a8; }

/* -------------------------------------------------------------- tables --- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
th { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); font-weight: 600; }
tr:hover td { background: var(--paper-dim); }
.table-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }

.pill { font-family: var(--mono); font-size: 12px; padding: 3px 10px; border-radius: 20px; font-weight: 600; }
.pill-admin { background: var(--ink); color: var(--gold-soft); }
.pill-user { background: var(--paper-dim); color: var(--ink-soft); border: 1px solid var(--line); }
.pill-active { background: var(--success-bg); color: var(--success); }
.pill-inactive { background: var(--error-bg); color: var(--error); }

/* ------------------------------------------------------------- stats --- */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 36px; }
.stat-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.stat-card .value { font-family: var(--serif); font-size: 34px; color: var(--ink); }
.stat-card .label { font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; font-family: var(--mono); margin-top: 4px; }

/* ------------------------------------------------------------ pricing --- */
.plan-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 26px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.plan-card .price { font-family: var(--serif); font-size: 36px; color: var(--ink); }
.plan-card .price small { font-family: var(--sans); font-size: 14px; color: var(--text-muted); font-weight: 400; }
.plan-card .credits { font-family: var(--mono); color: var(--gold); font-weight: 700; font-size: 14px; }

/* ------------------------------------------------------------- footer --- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
  color: var(--text-muted);
  font-size: 13.5px;
}
.site-footer .container { display: flex; justify-content: space-between; align-items: center; }
.footer-links { justify-content: flex-start !important; gap: 22px; padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--line); }
.footer-links a { color: var(--text-muted); font-size: 13px; }
.footer-links a:hover { color: var(--ink); }

/* ------------------------------------------------------------- utility --- */
.text-muted { color: var(--text-muted); }
.mt-0 { margin-top: 0; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-10 { gap: 10px; }

@media (max-width: 780px) {
  .grid-3, .grid-2, .stat-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 36px; }
  .field-row { flex-direction: column; gap: 0; }
  .nav-links { gap: 14px; }
}
