/* ==========================================================================
   LIC Calculator - Main Stylesheet
   A modern, responsive, SEO-optimized stylesheet for liccalculator.app
   ========================================================================== */

/* ---------- CSS Variables / Design Tokens ---------- */
:root {
  --primary: #1e3a8a;        /* Deep blue - trust */
  --primary-dark: #1e293b;
  --primary-light: #3b82f6;
  --accent: #f59e0b;         /* Gold - wealth */
  --accent-dark: #d97706;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #f59e0b;
  --info: #0ea5e9;

  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-muted: #f1f5f9;
  --bg-card: #ffffff;
  --bg-hero: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #2563eb 100%);

  --text: #0f172a;
  --text-muted: #475569;
  --text-light: #94a3b8;
  --text-on-dark: #ffffff;

  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 20px -5px rgba(15, 23, 42, 0.10), 0 4px 8px -4px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 40px -10px rgba(15, 23, 42, 0.15), 0 8px 16px -6px rgba(15, 23, 42, 0.10);

  --container: 1200px;
  --header-h: 72px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --transition: all 0.2s ease;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-light); text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 0.6em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: clamp(1.2rem, 2.4vw, 1.45rem); }
h4 { font-size: 1.15rem; }

p { margin-bottom: 1em; }
ul, ol { margin: 0 0 1em 1.25em; }
li { margin-bottom: 0.4em; }

::selection { background: var(--primary); color: #fff; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.section { padding: 64px 0; }
.section-sm { padding: 40px 0; }
.section-lg { padding: 88px 0; }

.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); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
@media (min-width: 600px) and (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Header / Navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--primary);
  text-decoration: none;
}
.brand-mark {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border-radius: 10px;
  display: grid; place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: var(--shadow);
}
.brand small { display: block; font-size: 0.7rem; color: var(--text-muted); font-weight: 500; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
}
.nav-menu a {
  display: inline-block;
  padding: 8px 12px;
  color: var(--text);
  font-weight: 500;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.nav-menu a:hover { background: var(--bg-muted); color: var(--primary); }
.nav-menu .has-sub { position: relative; }
.nav-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 8px;
  display: none;
  list-style: none;
  margin: 0;
}
.nav-menu .has-sub:hover .sub-menu { display: block; }
.nav-menu .sub-menu a { display: block; padding: 8px 12px; font-size: 0.92rem; }
.nav-menu .sub-menu a:hover { background: var(--bg-muted); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  width: 40px; height: 40px;
  cursor: pointer;
  color: var(--text);
}
.nav-toggle svg { width: 24px; height: 24px; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-menu {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 4px;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
  }
  .nav-menu.open { transform: translateX(0); }
  .nav-menu a { padding: 12px 14px; font-size: 1rem; }
  .nav-menu .has-sub .sub-menu { position: static; box-shadow: none; border: 0; padding: 0 0 0 14px; display: block; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.98rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); color: #fff; text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-accent { background: var(--accent); color: #1f2937; }
.btn-accent:hover { background: var(--accent-dark); color: #fff; text-decoration: none; }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--bg-muted); text-decoration: none; }
.btn-sm { padding: 8px 14px; font-size: 0.88rem; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  background: var(--bg-hero);
  color: var(--text-on-dark);
  padding: 72px 0 88px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 30%, rgba(245, 158, 11, 0.18), transparent 40%),
                    radial-gradient(circle at 80% 70%, rgba(59, 130, 246, 0.25), transparent 40%);
  pointer-events: none;
}
.hero > .container { position: relative; }
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.hero h1 { color: #fff; font-size: clamp(2rem, 4.5vw, 3rem); }
.hero p.lead { color: rgba(255,255,255,0.92); font-size: 1.1rem; max-width: 56ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 40px;
  max-width: 560px;
}
.hero-stat { background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.18); border-radius: var(--radius); padding: 16px; }
.hero-stat b { display: block; font-size: 1.6rem; color: #fff; }
.hero-stat span { color: rgba(255,255,255,0.8); font-size: 0.85rem; }
.hero-card {
  background: #fff;
  color: var(--text);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
}
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-title { font-size: 1.15rem; margin-bottom: 8px; }
.card-meta { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 12px; }
.card-link { color: var(--primary); font-weight: 600; font-size: 0.92rem; }

.calc-card {
  position: relative;
  padding: 24px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: var(--transition);
}
.calc-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.calc-card .icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  display: grid; place-items: center;
  margin-bottom: 16px;
  font-size: 1.4rem;
}
.calc-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.calc-card p { color: var(--text-muted); font-size: 0.94rem; margin-bottom: 14px; }

/* ---------- Calculator UI ---------- */
.calculator {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
  margin: 32px 0;
}
.calc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
@media (max-width: 700px) { .calc-grid { grid-template-columns: 1fr; } }
.calc-field { display: flex; flex-direction: column; gap: 6px; }
.calc-field label { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.calc-field .hint { color: var(--text-muted); font-size: 0.82rem; }
.calc-field input,
.calc-field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: var(--transition);
}
.calc-field input:focus,
.calc-field select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,138,0.12); }

.calc-field input[type="range"] { padding: 0; }
.calc-field .range-row { display: flex; gap: 10px; align-items: center; }
.calc-field .range-row input[type="range"] { flex: 1; accent-color: var(--primary); }
.calc-field .range-row .range-val { min-width: 90px; padding: 8px 12px; background: var(--bg-muted); border-radius: var(--radius-sm); font-weight: 600; text-align: right; font-size: 0.95rem; }

.calc-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-muted);
  padding: 4px;
  border-radius: var(--radius);
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.calc-tab {
  flex: 1;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.92rem;
  transition: var(--transition);
}
.calc-tab.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }

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

.calc-result {
  margin-top: 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border-radius: var(--radius);
  padding: 24px;
}
.calc-result h3 { color: #fff; margin-bottom: 14px; font-size: 1.1rem; }
.calc-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
}
.calc-result-item {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.calc-result-item .label { font-size: 0.8rem; color: rgba(255,255,255,0.85); display: block; margin-bottom: 4px; }
.calc-result-item .value { font-size: 1.3rem; font-weight: 700; color: #fff; }
.calc-result-item.highlight { background: var(--accent); color: #1f2937; border-color: var(--accent); }
.calc-result-item.highlight .label, .calc-result-item.highlight .value { color: #1f2937; }

.calc-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 18px;
  font-size: 0.92rem;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.calc-table th, .calc-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.calc-table thead th { background: var(--bg-muted); font-weight: 600; color: var(--text); }
.calc-table tbody tr:hover { background: var(--bg-soft); }
.calc-table tfoot td { font-weight: 700; background: var(--bg-soft); }

/* ---------- Section Headers ---------- */
.section-head { text-align: center; max-width: 720px; margin: 0 auto 40px; }
.section-head .eyebrow {
  display: inline-block;
  background: rgba(30,58,138,0.08);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.section-head p { color: var(--text-muted); font-size: 1.05rem; }

/* ---------- Trust Bar ---------- */
.trust-bar {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 24px 0;
}
.trust-items {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  text-align: center;
}
.trust-item .num { display: block; font-size: 1.6rem; font-weight: 800; color: var(--primary); }
.trust-item .lbl { color: var(--text-muted); font-size: 0.9rem; }
@media (max-width: 700px) { .trust-items { grid-template-columns: repeat(2, 1fr); } }

/* ---------- FAQ ---------- */
.faq { margin: 32px 0; }
.faq-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  transition: var(--transition);
}
.faq-item[open] { box-shadow: var(--shadow); border-color: var(--primary-light); }
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 22px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--text);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--primary);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-body { padding: 0 22px 20px; color: var(--text-muted); }

/* ---------- Tables (Generic Content) ---------- */
.content-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 0.94rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.content-table th, .content-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.content-table thead { background: var(--bg-muted); }
.content-table th { font-weight: 700; color: var(--text); }
.content-table tr:last-child td { border-bottom: 0; }

/* ---------- Prose / Article ---------- */
.prose { max-width: 800px; margin: 0 auto; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.3em; }
.prose p, .prose li { font-size: 1.02rem; color: #1e293b; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose a { color: var(--primary); text-decoration: underline; }
.prose blockquote {
  border-left: 4px solid var(--primary);
  background: var(--bg-soft);
  padding: 14px 18px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 18px 0;
  color: var(--text-muted);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.85);
  padding: 56px 0 24px;
  margin-top: 64px;
}
.site-footer h4 { color: #fff; margin-bottom: 14px; font-size: 1rem; }
.site-footer a { color: rgba(255,255,255,0.78); text-decoration: none; display: block; padding: 4px 0; font-size: 0.92rem; }
.site-footer a:hover { color: var(--accent); text-decoration: none; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
}

/* ---------- Misc ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 600; background: rgba(30,58,138,0.08); color: var(--primary); }
.badge-accent { background: rgba(245,158,11,0.12); color: var(--accent-dark); }
.badge-success { background: rgba(22,163,74,0.12); color: var(--success); }
.badge-danger { background: rgba(220,38,38,0.10); color: var(--danger); }

.alert {
  background: #fff8e1;
  border-left: 4px solid var(--accent);
  padding: 14px 18px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 18px 0;
  color: #78350f;
  font-size: 0.95rem;
}
.alert-info { background: #e0f2fe; border-color: var(--info); color: #075985; }
.alert-success { background: #dcfce7; border-color: var(--success); color: #166534; }
.alert-warn { background: #fef2f2; border-color: var(--danger); color: #991b1b; }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; margin: 12px 0; }
.tag-list li a { display: inline-block; padding: 4px 12px; background: var(--bg-muted); border-radius: 999px; font-size: 0.82rem; color: var(--text-muted); text-decoration: none; }
.tag-list li a:hover { background: var(--primary); color: #fff; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { padding: 14px 0; color: var(--text-muted); font-size: 0.9rem; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { margin: 0 6px; color: var(--text-light); }

/* ---------- Page hero (smaller, for inner pages) ---------- */
.page-hero {
  background: linear-gradient(135deg, #f0f4ff 0%, #e0eaff 100%);
  padding: 56px 0;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.page-hero h1 { color: var(--primary-dark); }
.page-hero p { color: var(--text-muted); max-width: 60ch; margin: 8px auto 0; }

/* ---------- Forms (Contact) ---------- */
.form { display: grid; gap: 14px; max-width: 560px; margin: 0 auto; }
.form label { font-weight: 600; font-size: 0.9rem; }
.form input, .form textarea, .form select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font: inherit;
  background: #fff;
  color: var(--text);
}
.form input:focus, .form textarea:focus, .form select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,138,0.12); }
.form textarea { min-height: 140px; resize: vertical; }

/* ---------- CTA Strip ---------- */
.cta-strip {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  padding: 48px 0;
  text-align: center;
}
.cta-strip h2 { color: #fff; margin-bottom: 10px; }
.cta-strip p { color: rgba(255,255,255,0.9); margin-bottom: 20px; }
.cta-strip .btn { background: #fff; color: var(--accent-dark); }
.cta-strip .btn:hover { background: var(--primary-dark); color: #fff; }

/* ---------- Ads placeholder (so design looks balanced even before ads run) ---------- */
.ad-slot {
  background: repeating-linear-gradient(45deg, #f1f5f9, #f1f5f9 10px, #e2e8f0 10px, #e2e8f0 20px);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  min-height: 90px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 24px 0;
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .nav-toggle, .ad-slot, .cta-strip { display: none; }
  body { font-size: 12pt; color: #000; }
}
