/* ============================================================
   Creative Earn — shared stylesheet
   Brand: dark navy #0A1633, electric blue #2563EB,
   purple #7C3AED, white. Mobile-first, system font stack.
   ============================================================ */

/* ---------- CSS variables ---------- */
:root {
  --navy: #0a1633;
  --navy-2: #12224d;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-light: #dbeafe;
  --purple: #7c3aed;
  --purple-light: #ede9fe;
  --white: #ffffff;
  --ink: #0f172a;
  --muted: #475569;
  --muted-light: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --surface: #ffffff;
  --success: #15803d;
  --warning-bg: #fef3c7;
  --warning-ink: #92400e;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 16px rgba(10, 22, 51, 0.08);
  --shadow-lg: 0 12px 32px rgba(10, 22, 51, 0.14);
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --max-width: 1120px;
  --header-h: 64px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5rem; color: var(--navy); letter-spacing: -0.02em; }
h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; margin-top: 2rem; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.25rem; }
li { margin-bottom: 0.35rem; }

/* Accessible focus states — visible on every interactive element */
:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip link for keyboard users */
.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 200;
  background: var(--navy); color: var(--white);
  padding: 0.6rem 1rem; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 1rem; color: var(--white); text-decoration: none; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1rem; }
.section { padding: 2.5rem 0; }
.section--white { background: var(--surface); }
.lead { font-size: 1.15rem; color: var(--muted); }
.answer { font-size: 1.1rem; line-height: 1.65; background: var(--blue-light); border-left: 4px solid var(--blue); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 0.9rem 1rem; margin: 1rem 0; }
.small { font-size: 0.875rem; color: var(--muted); }
.eyebrow {
  display: inline-block; font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--purple);
  margin-bottom: 0.5rem;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 6px rgba(10, 22, 51, 0.06);
}
.header-inner {
  display: flex; align-items: center; gap: 1rem;
  min-height: var(--header-h);
}
.brand { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand img { height: 40px; width: auto; }
.brand-name { font-weight: 800; font-size: 1.15rem; color: var(--navy); letter-spacing: -0.02em; }
.nav-toggle {
  margin-left: auto; background: none; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 0.5rem 0.7rem;
  font-size: 1.25rem; line-height: 1; cursor: pointer; color: var(--navy);
}
.main-nav { display: none; width: 100%; }
.main-nav.open { display: block; }
.main-nav ul {
  list-style: none; margin: 0; padding: 0.5rem 0 1rem;
  display: flex; flex-direction: column; gap: 0.15rem;
}
.main-nav a {
  display: block; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm);
  color: var(--ink); font-weight: 500; font-size: 0.95rem;
}
.main-nav a:hover { background: var(--blue-light); text-decoration: none; color: var(--navy); }
.main-nav a.active { background: var(--navy); color: var(--white); }
.nav-auth { display: flex; gap: 0.5rem; padding-bottom: 1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 0.65rem 1.25rem; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 0.95rem; line-height: 1.4; cursor: pointer;
  border: 1px solid transparent; text-align: center;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--blue-dark); }
.btn-secondary { background: var(--navy); color: var(--white); }
.btn-secondary:hover { background: var(--navy-2); }
.btn-outline { background: transparent; border-color: var(--blue); color: var(--blue); }
.btn-outline:hover { background: var(--blue-light); }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.875rem; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, #16265c 55%, var(--purple) 130%);
  color: var(--white); padding: 3.5rem 0 3rem;
}
.hero h1 { color: var(--white); font-size: 2.5rem; }
.hero p { color: #cbd5e1; font-size: 1.15rem; max-width: 620px; }
.hero .tagline { color: #93c5fd; font-weight: 700; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.hero .btn-outline { border-color: var(--white); color: var(--white); }
.hero .btn-outline:hover { background: rgba(255, 255, 255, 0.12); }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
.card-icon { font-size: 1.75rem; line-height: 1; margin-bottom: 0.75rem; }
.card p:last-child { margin-bottom: 0; }
.price { font-size: 1.5rem; font-weight: 800; color: var(--navy); }
.price-note { font-size: 0.875rem; color: var(--muted); }
.badge {
  display: inline-block; background: var(--purple-light); color: var(--purple);
  font-size: 0.75rem; font-weight: 700; padding: 0.2rem 0.6rem;
  border-radius: 999px; text-transform: uppercase; letter-spacing: 0.05em;
}

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1rem; }
label { display: block; font-weight: 600; margin-bottom: 0.35rem; color: var(--navy); }
input[type="text"], input[type="email"], input[type="tel"],
input[type="password"], select, textarea {
  width: 100%; padding: 0.65rem 0.8rem; font: inherit;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 3px solid var(--blue); outline-offset: 1px; border-color: var(--blue);
}
textarea { min-height: 140px; resize: vertical; }
.field-error { color: #b91c1c; font-size: 0.875rem; margin-top: 0.25rem; }
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] {
  border-color: #b91c1c;
}
.form-note { font-size: 0.875rem; color: var(--muted); }

/* ---------- Notices (honest "not connected yet" state) ---------- */
.notice {
  border-radius: var(--radius-sm); padding: 1rem 1.25rem; margin: 1rem 0;
  border: 1px solid var(--line); background: var(--warning-bg); color: var(--warning-ink);
}
.notice--info { background: var(--blue-light); color: var(--navy); }
.notice--success { background: #dcfce7; color: var(--success); }
.notice p:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #cbd5e1; padding: 2.5rem 0 1.5rem; margin-top: 2rem; }
.site-footer h3, .site-footer h4 { color: var(--white); }
.site-footer a { color: #93c5fd; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
.footer-grid ul { list-style: none; padding: 0; }
.footer-grid li { margin-bottom: 0.4rem; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin-top: 2rem; padding-top: 1rem; font-size: 0.875rem; color: #94a3b8;
}

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 150;
  background: var(--navy); color: var(--white);
  border-radius: var(--radius); padding: 1rem 1.25rem;
  box-shadow: var(--shadow-lg); display: none;
  max-width: 560px; margin: 0 auto;
}
.cookie-banner.show { display: block; }
.cookie-banner p { margin: 0 0 0.75rem; font-size: 0.9rem; }
.cookie-banner a { color: #93c5fd; }
.cookie-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ---------- Dashboard layout basics (for later feature pages) ---------- */
.dashboard { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
.dashboard-sidebar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.dashboard-sidebar ul { list-style: none; padding: 0; margin: 0; }
.dashboard-sidebar a { display: block; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); color: var(--ink); }
.dashboard-sidebar a.active, .dashboard-sidebar a:hover { background: var(--blue-light); text-decoration: none; }
.dashboard-main { min-width: 0; }

/* ---------- Misc ---------- */
.page-head { padding: 2.5rem 0 0.5rem; }
.page-head h1 { margin-bottom: 0.5rem; }
.prose { max-width: 760px; }
.prose h2 { margin-top: 2.25rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
th, td { text-align: left; padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--line); }
th { background: var(--navy); color: var(--white); }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1.25rem; margin-bottom: 0.75rem; }
.faq summary { font-weight: 700; color: var(--navy); cursor: pointer; }
.faq p { margin: 0.75rem 0 0; }
.cta-band {
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: var(--white); border-radius: var(--radius); padding: 2rem; text-align: center;
}
.cta-band h2 { color: var(--white); margin-top: 0; }
.cta-band p { color: #e0e7ff; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Responsive breakpoints ---------- */
@media (min-width: 640px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  h1 { font-size: 2.75rem; }
  .hero h1 { font-size: 3rem; }
}
@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .header-inner { flex-wrap: wrap; }
  .main-nav { display: block; width: auto; margin-left: auto; }
  .main-nav ul { flex-direction: row; flex-wrap: wrap; padding: 0; gap: 0.1rem; }
  .main-nav a { padding: 0.45rem 0.6rem; }
  .nav-auth { padding-bottom: 0; }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .dashboard { grid-template-columns: 240px 1fr; }
  .section { padding: 3.5rem 0; }
}

/* ---------- Feature pages (added Dec 2026) ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }
.filter-btn {
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  border-radius: 999px; padding: 0.45rem 0.9rem; font: inherit; font-size: 0.9rem;
  font-weight: 600; cursor: pointer;
}
.filter-btn:hover { border-color: var(--blue); }
.filter-btn.active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.search-input { max-width: 560px; }
.tool-card { display: flex; flex-direction: column; }
.tool-card h3 { margin-bottom: 0.25rem; }
.tool-card .tool-meta { margin-top: auto; padding-top: 0.75rem; }
.tool-card .pricing { font-size: 0.875rem; color: var(--muted); margin: 0.5rem 0; }
.cart-box { position: sticky; top: 80px; }
.cart-line { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.4rem 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.cart-total { font-weight: 800; font-size: 1.1rem; color: var(--navy); padding-top: 0.5rem; }
.gen-card textarea { min-height: 100px; }
.prompt-box { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.75rem 1rem; font-size: 0.95rem; margin-bottom: 0.75rem; }
.admin-grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .admin-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .admin-grid { grid-template-columns: repeat(3, 1fr); } }
.empty-state { color: var(--muted); font-style: italic; }
.tag-list { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; margin: 0 0 1rem; }
.tag-list li { background: var(--blue-light); color: var(--navy); border-radius: 999px; padding: 0.2rem 0.7rem; font-size: 0.85rem; }
.article-meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 1rem; }
