/* =========================================================
   Savings Calculator 2027 — Main Stylesheet
   ========================================================= */

:root {
  --color-primary: #0f766e;      /* teal — trust + growth */
  --color-primary-dark: #0b544e;
  --color-primary-light: #ccfbf1;
  --color-accent: #f59e0b;       /* amber — CTA highlights */
  --color-text: #1f2937;
  --color-text-muted: #6b7280;
  --color-bg: #ffffff;
  --color-bg-alt: #f8fafc;
  --color-border: #e5e7eb;
  --color-success: #16a34a;
  --color-danger: #dc2626;

  --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.14);

  --container-width: 1140px;
}

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

body {
  margin: 0;
  font-family: var(--font-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

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

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 10px 16px;
  z-index: 1000;
}
.skip-link:focus { left: 10px; top: 10px; }

h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; margin: 0 0 0.6em; }
h1 { font-size: clamp(1.9rem, 3.2vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); margin-top: 2.2em; }
h3 { font-size: 1.2rem; margin-top: 1.6em; }
p { margin: 0 0 1.1em; color: var(--color-text); }
.text-muted { color: var(--color-text-muted); }

.lead {
  font-size: 1.15rem;
  color: var(--color-text-muted);
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--color-primary-dark); color: #fff; text-decoration: none; transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--color-primary);
  color: var(--color-primary);
}
.btn-outline:hover { background: var(--color-primary-light); text-decoration: none; }
.btn-block { width: 100%; text-align: center; }

/* ---------------- Header / Nav ---------------- */
.site-header {
  border-bottom: 1px solid var(--color-border);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--color-text);
}
.logo:hover { text-decoration: none; color: var(--color-text); }
.logo-text { letter-spacing: -0.02em; }

.site-nav ul {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.98rem;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--color-text);
  display: block;
}

/* ---------------- Breadcrumb ---------------- */
.breadcrumb { padding: 14px 20px; }
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.88rem;
  color: var(--color-text-muted);
}
.breadcrumb li:not(:last-child)::after { content: "/"; margin-left: 6px; color: var(--color-border); }
.breadcrumb a { color: var(--color-text-muted); }

/* ---------------- Hero ---------------- */
.hero {
  background: linear-gradient(180deg, var(--color-primary-light) 0%, #ffffff 100%);
  padding: 56px 0 40px;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}
.hero-badge {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--color-primary);
  color: var(--color-primary-dark);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.hero-actions { display: flex; gap: 14px; margin-top: 22px; flex-wrap: wrap; }

/* ---------------- Cards / Grids ---------------- */
.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.section { padding: 56px 0; }
.section-alt { background: var(--color-bg-alt); }
.section-header { max-width: 680px; margin-bottom: 34px; }

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

.tool-card {
  padding: 26px;
  transition: box-shadow .15s ease, transform .15s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.tool-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.tool-card .icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.tool-card h3 { margin-top: 0; font-size: 1.1rem; }
.tool-card p { color: var(--color-text-muted); flex-grow: 1; font-size: 0.95rem; }
.tool-card .btn { margin-top: 12px; align-self: flex-start; }

.feature-item { display: flex; gap: 14px; align-items: flex-start; }
.feature-item .icon {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  display: flex; align-items: center; justify-content: center;
}
.feature-item h4 { margin: 0 0 4px; font-size: 1rem; }
.feature-item p { margin: 0; color: var(--color-text-muted); font-size: 0.93rem; }

/* ---------------- Calculator Widget ---------------- */
.calc-widget {
  padding: 28px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.calc-widget h2 { margin-top: 0; font-size: 1.3rem; }
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.field { margin-bottom: 4px; }
.field label {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-text);
}
.field label .unit { color: var(--color-text-muted); font-weight: 400; }
.field input[type="number"],
.field input[type="text"],
.field input[type="email"],
.field textarea,
.field select {
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--color-text);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.field-hint { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 4px; }

.calc-actions { margin-top: 20px; display: flex; gap: 12px; }

.calc-results {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px dashed var(--color-border);
}
.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}
.result-box {
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}
.result-box .label { font-size: 0.82rem; color: var(--color-text-muted); margin-bottom: 4px; }
.result-box .value { font-size: 1.4rem; font-weight: 800; color: var(--color-primary-dark); }
.result-box.accent .value { color: var(--color-accent); }

#chartCanvas, canvas.calc-chart { max-width: 100%; }

table.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 18px;
}
table.schedule-table th,
table.schedule-table td {
  text-align: right;
  padding: 9px 10px;
  border-bottom: 1px solid var(--color-border);
}
table.schedule-table th:first-child,
table.schedule-table td:first-child { text-align: left; }
table.schedule-table thead th {
  background: var(--color-bg-alt);
  font-weight: 700;
}

/* ---------------- Article / Content ---------------- */
.article-layout {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 40px;
  align-items: start;
}
.article-content { min-width: 0; }
.article-content h2 { border-top: 1px solid var(--color-border); padding-top: 0.6em; }
.article-content h2:first-of-type { border-top: none; padding-top: 0; }
.article-content ul, .article-content ol { padding-left: 1.3em; }
.article-content li { margin-bottom: 0.4em; }
.article-content blockquote {
  margin: 1.4em 0;
  padding: 14px 20px;
  background: var(--color-bg-alt);
  border-left: 4px solid var(--color-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.sidebar { position: sticky; top: 90px; }
.sidebar .card { padding: 20px; margin-bottom: 20px; }
.sidebar h3 { margin-top: 0; font-size: 1rem; }
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li { margin-bottom: 10px; }
.sidebar li a { font-size: 0.92rem; }

.author-box {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px;
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
  margin: 2em 0;
}
.author-box .avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}
.author-box .author-name { font-weight: 700; margin: 0; }
.author-box .author-desc { margin: 2px 0 0; font-size: 0.88rem; color: var(--color-text-muted); }

.faq-item { margin-bottom: 18px; }
.faq-item h3 { margin-bottom: 6px; font-size: 1.02rem; }

/* ---------------- Blog cards ---------------- */
.blog-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}
.blog-card img { width: 100%; height: 170px; object-fit: cover; }
.blog-card .blog-card-body { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.blog-card .blog-meta { font-size: 0.8rem; color: var(--color-text-muted); margin-bottom: 8px; }
.blog-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.blog-card p { color: var(--color-text-muted); font-size: 0.92rem; flex-grow: 1; }

/* ---------------- Forms (contact) ---------------- */
.form-card { padding: 30px; max-width: 640px; }

/* ---------------- Trust strip ---------------- */
.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  justify-content: center;
  padding: 22px 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.88rem;
}
.trust-strip span { display: flex; align-items: center; gap: 8px; }

/* ---------------- Ad slots ---------------- */
.ad-slot { width: 100%; }
.ad-slot--placeholder {
  height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: none;
}
.ad-slot--live {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  background: var(--color-bg-alt);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  margin: 24px 0;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ---------------- Footer ---------------- */
.site-footer {
  background: #0b1220;
  color: #cbd5e1;
  padding: 50px 0 0;
  margin-top: 60px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 30px;
  padding-bottom: 34px;
}
.footer-col h3 { color: #fff; font-size: 0.95rem; margin-bottom: 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { color: #94a3b8; font-size: 0.9rem; }
.footer-col a:hover { color: #fff; }
.footer-brand p { color: #94a3b8; font-size: 0.88rem; margin-top: 12px; }
.footer-brand .logo { color: #fff; }
.footer-bottom {
  border-top: 1px solid #1e293b;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.82rem;
  color: #64748b;
}
.footer-disclaimer a { color: #94a3b8; text-decoration: underline; }

/* ---------------- Utility ---------------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.badge {
  display: inline-block;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .article-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .site-nav {
    position: absolute;
    top: 72px; left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    display: none;
    box-shadow: var(--shadow-md);
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; padding: 10px 20px 18px; }
  .site-nav a { display: block; padding: 12px 0; border-bottom: 1px solid var(--color-border); }
  .nav-toggle { display: flex; }

  .calc-grid { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  table.schedule-table { display: block; overflow-x: auto; white-space: nowrap; }
}
