/* ==========================================================================
   1099 Freelancer Quarterly Tax Calculator — shared stylesheet
   Palette: navy / teal / gold, matching the Freelancer Tax & Invoice
   Tracker 2026 Gumroad template.
   ========================================================================== */

:root {
  /* Brand palette */
  --navy: #1F3864;
  --navy-dark: #16294A;
  --navy-light: #E7ECF4;
  --teal: #0F6E6E;
  --teal-dark: #0B5252;
  --teal-light: #D9F0EE;
  --cream: #FBFAF7;
  --cream-dark: #EFEDE6;
  --ink: #21242B;
  --ink-soft: #5B6270;
  --gold: #C9982A;
  --gold-dark: #A67D22;
  --white: #FFFFFF;
  --danger: #B5544A;
  --success: #1F7A5C;

  /* Type */
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Layout */
  --max-width: 1080px;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 6px 24px rgba(31, 56, 100, 0.10);
  --shadow-sm: 0 2px 10px rgba(31, 56, 100, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--navy);
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 600;
}
h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
a { color: var(--teal-dark); }
a:hover { color: var(--gold); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------------- Header / Nav ---------------- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--cream-dark);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  gap: 1rem;
}
.brand {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--navy);
  text-decoration: none;
  white-space: nowrap;
}
.brand span { color: var(--gold); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--teal);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  cursor: pointer;
}
.nav-toggle svg { display: block; }

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.main-nav a {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 500;
}
.main-nav a:hover, .main-nav a.active { color: var(--teal-dark); }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .main-nav {
    display: none;
    width: 100%;
    order: 3;
  }
  .main-nav.open { display: block; }
  .main-nav ul {
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.75rem 0;
  }
  .main-nav a { display: block; padding: 0.55rem 0; border-bottom: 1px solid var(--cream-dark); }
  .site-header .container { flex-wrap: wrap; }
}

/* ---------------- Hero ---------------- */
.hero {
  padding: 2.75rem 0 2rem;
  text-align: center;
}
.hero .eyebrow {
  display: inline-block;
  background: var(--navy-light);
  color: var(--navy);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.hero p.lede {
  max-width: 660px;
  margin: 0 auto 1.25rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

/* ---------------- Disclaimer ---------------- */
.disclaimer {
  background: #FDEBEB;
  border: 1px solid #E9C4C0;
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  font-size: 0.86rem;
  color: #7A2E27;
  margin: 1.25rem 0;
}
.disclaimer strong { color: #5E211C; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-block;
  border-radius: 999px;
  padding: 0.75rem 1.6rem;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--navy);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--teal-dark); color: var(--white); }
.btn-gold {
  background: var(--gold);
  color: var(--white);
}
.btn-gold:hover { background: var(--gold-dark); color: var(--white); }
.btn-outline {
  background: transparent;
  border-color: var(--teal);
  color: var(--teal-dark);
}
.btn-outline:hover { background: var(--teal-light); color: var(--teal-dark); }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }

/* ---------------- Cards / Sections ---------------- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
section { padding: 2.5rem 0; }
section.alt { background: var(--white); }
section.navy-tint { background: var(--navy-light); }
.section-title { text-align: center; margin-bottom: 1.75rem; }
.section-title p { color: var(--ink-soft); max-width: 640px; margin: 0.5rem auto 0; }

/* ---------------- Calculator Form ---------------- */
.calc-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}
@media (min-width: 900px) {
  .calc-shell { grid-template-columns: 1.05fr 0.95fr; align-items: start; }
}

.toggle-row {
  display: flex;
  background: var(--cream-dark);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 1.5rem;
  gap: 4px;
}
.toggle-row button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.6rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--ink-soft);
}
.toggle-row button.active {
  background: var(--white);
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}

.field { margin-bottom: 1.35rem; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.45rem;
  color: var(--ink);
}
.field .hint { font-size: 0.8rem; color: var(--ink-soft); margin-top: 0.35rem; }
.field input[type="number"],
.field input[type="text"],
.field input[type="email"],
.field select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--teal);
}
.field input[type="range"] {
  width: 100%;
  accent-color: var(--navy);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--navy-light);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 1.35rem;
}
.switch-row .switch-label { font-weight: 600; font-size: 0.92rem; color: var(--navy); }
.switch-row .switch-desc { font-size: 0.78rem; color: var(--ink-soft); margin-top: 0.15rem; }
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #C7CCD6;
  border-radius: 999px;
  transition: 0.15s;
}
.switch .slider::before {
  position: absolute;
  content: "";
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.15s;
}
.switch input:checked + .slider { background-color: var(--teal); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ---------------- Results ---------------- */
.results-card { position: sticky; top: 90px; }
.results-total {
  text-align: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--cream-dark);
  margin-bottom: 1rem;
}
.results-total .amount {
  font-family: var(--font-serif);
  font-size: 2.3rem;
  color: var(--navy);
  font-weight: 700;
}
.results-total .label { color: var(--ink-soft); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }

.chart-wrap { max-width: 260px; margin: 0 auto 1.25rem; }

.breakdown-list { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.breakdown-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--cream-dark);
  font-size: 0.92rem;
}
.breakdown-list li:last-child { border-bottom: none; }
.swatch { width: 11px; height: 11px; border-radius: 50%; display: inline-block; margin-right: 0.55rem; flex-shrink: 0; }
.bd-label { display: flex; align-items: center; flex: 1; }
.bd-amount { font-weight: 700; color: var(--ink); margin-left: 0.5rem; }
.bd-pct { color: var(--ink-soft); font-size: 0.8rem; margin-left: 0.35rem; min-width: 2.6rem; text-align: right; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin: 1.25rem 0;
}
.stat-box {
  background: var(--navy-light);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  text-align: center;
}
.stat-box .stat-value { font-weight: 700; color: var(--navy); font-size: 1.15rem; font-family: var(--font-serif); }
.stat-box .stat-label { font-size: 0.72rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.03em; margin-top: 0.15rem; }

.results-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; }

.quarter-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin: 1.5rem 0;
}
@media (max-width: 560px) { .quarter-grid { grid-template-columns: 1fr; } }
.quarter-card {
  background: var(--white);
  border: 1px solid var(--cream-dark);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow-sm);
}
.quarter-card .q-label { font-weight: 700; color: var(--navy); font-size: 0.95rem; }
.quarter-card .q-period { font-size: 0.78rem; color: var(--ink-soft); margin: 0.15rem 0 0.5rem; }
.quarter-card .q-amount { font-family: var(--font-serif); font-size: 1.5rem; color: var(--teal-dark); font-weight: 700; }
.quarter-card .q-due { font-size: 0.8rem; color: var(--ink-soft); margin-top: 0.25rem; }
.quarter-card .q-due strong { color: var(--gold-dark); }

/* ---------------- CTA block ---------------- */
.cta-block {
  background: linear-gradient(135deg, var(--navy), var(--teal-dark));
  color: var(--white);
  border-radius: var(--radius);
  padding: 2.25rem 1.75rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.cta-block h2, .cta-block h3 { color: var(--white); }
.cta-block p { color: rgba(255,255,255,0.92); max-width: 560px; margin-left: auto; margin-right: auto; }
.cta-block .price-tag {
  display: inline-block;
  background: var(--gold);
  color: var(--white);
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}
.cta-block .btn-gold { margin-top: 0.75rem; }
.cta-block ul.included {
  list-style: none;
  padding: 0;
  margin: 1.1rem auto 0;
  max-width: 480px;
  text-align: left;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 1rem;
}
.cta-block ul.included li { font-size: 0.85rem; padding-left: 1.3rem; position: relative; }
.cta-block ul.included li::before { content: "✓"; position: absolute; left: 0; color: var(--gold); font-weight: 700; }

.cta-inline {
  background: var(--teal-light);
  border: 1px solid var(--teal);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}
.cta-inline p { margin-bottom: 0.6rem; }

.article-cta {
  background: var(--navy-light);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin: 1.75rem 0;
  text-align: center;
}
.article-cta .btn { margin: 0.35rem; }

/* ---------------- Shop / product cards ---------------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}
.product-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.product-card img { width: 100%; height: 180px; object-fit: cover; background: var(--navy-light); }
.product-card .pc-body { padding: 1.1rem 1.25rem 1.35rem; display: flex; flex-direction: column; flex: 1; }
.product-card h3 { margin-bottom: 0.35rem; font-size: 1.05rem; }
.product-card p.pc-desc { color: var(--ink-soft); font-size: 0.88rem; flex: 1; }
.product-card .pc-price { font-weight: 700; color: var(--navy); font-size: 1.05rem; margin-bottom: 0.75rem; }
.product-card.featured { border: 2px solid var(--gold); }

/* ---------------- Infographic / comparison tables ---------------- */
table.compare-table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: 0.92rem; }
table.compare-table th, table.compare-table td { text-align: left; padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--cream-dark); }
table.compare-table th { color: var(--navy); font-family: var(--font-serif); background: var(--navy-light); }
table.compare-table td.num, table.compare-table th.num { text-align: right; }
table.compare-table tr.highlight td { font-weight: 700; color: var(--navy); }

/* ---------------- Articles ---------------- */
.article-body { max-width: 720px; margin: 0 auto; }
.article-body h2 { margin-top: 2rem; }
.article-body h3 { margin-top: 1.5rem; }
.article-body ul, .article-body ol { padding-left: 1.4rem; }
.article-meta { color: var(--ink-soft); font-size: 0.85rem; margin-bottom: 1.5rem; }
.pull-quote {
  border-left: 4px solid var(--teal);
  background: var(--teal-light);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  margin: 1.5rem 0;
}
.source-note { font-size: 0.78rem; color: var(--ink-soft); }
.sources-block {
  background: var(--white);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.sources-block h4 { font-size: 0.85rem; margin-bottom: 0.5rem; color: var(--navy); }
.sources-block ul { margin: 0; padding-left: 1.1rem; }
table.cost-table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: 0.92rem; }
table.cost-table th, table.cost-table td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--cream-dark); }
table.cost-table th { color: var(--navy); font-family: var(--font-serif); }

/* ---------------- Footer ---------------- */
.site-footer {
  background: var(--navy);
  color: var(--navy-light);
  padding: 2.5rem 0 1.5rem;
  margin-top: 3rem;
  font-size: 0.88rem;
}
.site-footer a { color: var(--white); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1.5rem; margin-bottom: 1.5rem; }
.footer-grid h4 { color: var(--white); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.65rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 0.4rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.15); padding-top: 1.25rem; opacity: 0.85; font-size: 0.8rem; }

/* ---------------- Utility ---------------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.small { font-size: 0.85rem; color: var(--ink-soft); }
.badge {
  display: inline-block;
  background: var(--teal-light);
  color: var(--teal-dark);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
hr.divider { border: none; border-top: 1px solid var(--cream-dark); margin: 2rem 0; }

canvas#pngExportCanvas { display: none; }
