/* ============================================
   SalarySacrificeCalc.co.uk - Main Stylesheet
   Professional UK Finance Calculator
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=Playfair+Display:wght@600;700&display=swap');

:root {
  --navy: #0f2044;
  --navy-mid: #1a3260;
  --teal: #0891b2;
  --teal-light: #06b6d4;
  --accent: #10b981;
  --accent-light: #34d399;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.06);
  --radius: 12px;
  --radius-lg: 20px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

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

/* ---- TYPOGRAPHY ---- */
h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; }
h1 { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3rem); color: var(--navy); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); color: var(--navy); }
h3 { font-size: 1.25rem; color: var(--navy); }
p { color: var(--text-muted); }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-light); }

/* ---- LAYOUT ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 4rem 0; }
.section-sm { padding: 2rem 0; }

/* ---- HEADER ---- */
header {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.15);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--teal);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

nav { display: flex; align-items: center; gap: 0.5rem; }

nav a {
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  transition: all 0.2s;
  text-decoration: none;
}

nav a:hover { color: white; background: rgba(255,255,255,0.1); }

.nav-dropdown { position: relative; }

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  transition: all 0.2s;
  background: none;
  border: none;
}

.nav-dropdown-toggle:hover { color: white; background: rgba(255,255,255,0.1); }

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 240px;
  padding: 0.5rem;
  z-index: 200;
}

.nav-dropdown:hover .nav-dropdown-menu { display: block; }

.nav-dropdown-menu a {
  display: block;
  color: var(--text);
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
}

.nav-dropdown-menu a:hover { background: var(--bg); color: var(--teal); }

.btn-cta {
  background: var(--accent);
  color: white !important;
  padding: 0.6rem 1.25rem !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 0.875rem !important;
  transition: all 0.2s !important;
}

.btn-cta:hover { background: var(--accent-light) !important; transform: translateY(-1px); }

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

/* ---- HERO ---- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 60%, #1e4080 100%);
  color: white;
  padding: 4rem 0 5rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(8,145,178,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(16,185,129,0.15);
  border: 1px solid rgba(16,185,129,0.3);
  color: var(--accent-light);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 100px;
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
}

.hero h1 { color: white; margin-bottom: 1rem; }
.hero p { color: rgba(255,255,255,0.75); font-size: 1.1rem; margin-bottom: 2rem; }

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn-primary {
  background: var(--accent);
  color: white;
  padding: 0.875rem 1.75rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.btn-primary:hover { background: var(--accent-light); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(16,185,129,0.3); color: white; }

.btn-secondary {
  background: rgba(255,255,255,0.1);
  color: white;
  padding: 0.875rem 1.75rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-secondary:hover { background: rgba(255,255,255,0.2); color: white; }

.trust-signals {
  display: flex;
  gap: 1.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
}

.trust-item span { color: var(--accent-light); }

.hero-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  backdrop-filter: blur(10px);
}

.hero-card-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.savings-display {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.savings-item { text-align: center; }
.savings-label { font-size: 0.75rem; color: rgba(255,255,255,0.5); margin-bottom: 0.25rem; }
.savings-value { font-size: 1.75rem; font-weight: 700; color: white; }
.savings-value.accent { color: var(--accent-light); }

.savings-bar {
  background: rgba(255,255,255,0.1);
  border-radius: 100px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.savings-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--accent));
  border-radius: 100px;
  width: 68%;
  animation: fillBar 1.5s ease-out;
}

@keyframes fillBar { from { width: 0; } to { width: 68%; } }

/* ---- CARDS ---- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  border: 1px solid var(--border-light);
}

.card-lg { padding: 2rem; border-radius: var(--radius-lg); }

/* ---- CALCULATOR ---- */
.calc-section {
  padding: 3rem 0;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.calc-sticky { position: sticky; top: 80px; }

.calc-header {
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  color: white;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius) var(--radius) 0 0;
  margin: -1.5rem -1.5rem 1.5rem;
}

.calc-header h2 { color: white; font-size: 1.1rem; margin: 0; }
.calc-header p { color: rgba(255,255,255,0.6); font-size: 0.8rem; margin: 0; }

.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

.form-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(8,145,178,0.1);
  background: white;
}

.input-prefix {
  position: relative;
}

.input-prefix .form-input { padding-left: 2.25rem; }

.prefix-symbol {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-weight: 600;
  pointer-events: none;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.calc-btn {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--teal), var(--navy-mid));
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.5rem;
}

.calc-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(8,145,178,0.3); }

/* ---- RESULTS ---- */
.results-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.results-header {
  background: linear-gradient(135deg, var(--accent), #059669);
  padding: 1.5rem;
  color: white;
}

.results-header h3 { color: white; margin-bottom: 0.25rem; }
.results-header p { color: rgba(255,255,255,0.75); font-size: 0.85rem; }

.results-body { padding: 1.5rem; }

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-light);
}

.result-row:last-child { border-bottom: none; }
.result-label { font-size: 0.875rem; color: var(--text-muted); }
.result-value { font-size: 0.95rem; font-weight: 600; color: var(--text); }
.result-value.highlight { color: var(--accent); font-size: 1.1rem; }
.result-value.saving { color: var(--accent); }
.result-value.deduction { color: #ef4444; }

.results-summary {
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: 1rem;
  text-align: center;
}

.summary-label { color: rgba(255,255,255,0.6); font-size: 0.8rem; margin-bottom: 0.25rem; }
.summary-value { color: white; font-size: 2rem; font-weight: 700; }
.summary-sub { color: var(--accent-light); font-size: 0.85rem; }

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

.btn-action {
  flex: 1;
  padding: 0.6rem;
  border: 1.5px solid var(--border);
  background: white;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}

.btn-action:hover { border-color: var(--teal); color: var(--teal); }

/* ---- CHART ---- */
.chart-container {
  margin: 1.5rem 0;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.chart-bars {
  display: flex;
  gap: 1.5rem;
  align-items: flex-end;
  height: 160px;
  margin-bottom: 0.75rem;
}

.chart-bar-group { flex: 1; display: flex; gap: 0.5rem; align-items: flex-end; }

.chart-bar {
  flex: 1;
  border-radius: 6px 6px 0 0;
  transition: height 0.5s ease;
  min-height: 4px;
}

.chart-bar.before { background: var(--text-light); }
.chart-bar.after { background: linear-gradient(180deg, var(--teal-light), var(--teal)); }
.chart-bar.saving { background: linear-gradient(180deg, var(--accent-light), var(--accent)); }

.chart-labels { display: flex; gap: 1.5rem; }
.chart-label { flex: 1; text-align: center; font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }

.chart-legend {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.legend-item { display: flex; align-items: center; gap: 0.4rem; font-size: 0.75rem; color: var(--text-muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }

/* ---- FEATURES GRID ---- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.feature-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.feature-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--teal), var(--navy-mid));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.feature-card h3 { font-size: 1rem; margin-bottom: 0.4rem; }
.feature-card p { font-size: 0.85rem; }

/* ---- CALCULATOR CARDS ---- */
.calculators-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.calc-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  text-decoration: none;
  display: block;
}

.calc-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--teal); }

.calc-card-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.calc-card h3 { font-size: 0.95rem; margin-bottom: 0.4rem; color: var(--navy); }
.calc-card p { font-size: 0.8rem; color: var(--text-muted); }
.calc-card-link { font-size: 0.8rem; color: var(--teal); font-weight: 600; margin-top: 0.75rem; display: block; }

/* ---- FAQ ---- */
.faq-list { max-width: 800px; margin: 0 auto; }

.faq-item {
  background: white;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 1.25rem 1.5rem;
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color 0.2s;
}

.faq-question:hover { color: var(--teal); }
.faq-chevron { transition: transform 0.3s; font-size: 0.8rem; color: var(--text-muted); }
.faq-item.open .faq-chevron { transform: rotate(180deg); }

.faq-answer {
  display: none;
  padding: 0 1.5rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.faq-item.open .faq-answer { display: block; }

/* ---- DISCLAIMER ---- */
.disclaimer {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 0.82rem;
  color: #92400e;
  line-height: 1.6;
}

.disclaimer strong { color: #78350f; }

/* ---- AD SLOTS ---- */
.ad-slot {
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-light);
  font-size: 0.8rem;
  margin: 1.5rem 0;
}

/* ---- BREADCRUMB ---- */
.breadcrumb {
  padding: 1rem 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--teal); }
.breadcrumb span { margin: 0 0.4rem; }

/* ---- FOOTER ---- */
footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.footer-brand { }
.footer-brand .logo { margin-bottom: 0.75rem; }
.footer-brand p { font-size: 0.85rem; line-height: 1.6; max-width: 280px; }

.footer-col h4 { color: white; font-size: 0.85rem; font-weight: 700; margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 0.05em; }

.footer-col a {
  display: block;
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
  text-decoration: none;
}

.footer-col a:hover { color: var(--teal-light); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom p { font-size: 0.8rem; }
.footer-disclaimer { font-size: 0.75rem; color: rgba(255,255,255,0.4); max-width: 600px; }

/* ---- COOKIE BANNER ---- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--navy);
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
  flex-wrap: wrap;
}

.cookie-banner p { font-size: 0.85rem; color: rgba(255,255,255,0.8); }
.cookie-banner a { color: var(--teal-light); }

.cookie-actions { display: flex; gap: 0.75rem; }

.btn-cookie-accept {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
}

.btn-cookie-decline {
  background: transparent;
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: var(--font-body);
}

/* ---- PAGE HEADER ---- */
.page-header {
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  padding: 3rem 0;
  color: white;
}

.page-header h1 { color: white; font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 0.5rem; }
.page-header p { color: rgba(255,255,255,0.7); font-size: 1rem; }

/* ---- UTILS ---- */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.hidden { display: none; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(8,145,178,0.1);
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 100px;
  border: 1px solid rgba(8,145,178,0.2);
}

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal);
  margin-bottom: 0.5rem;
}

/* ---- PRINT ---- */
@media print {
  header, footer, .cookie-banner, .ad-slot, .results-actions, .calc-btn { display: none; }
  .calc-grid { grid-template-columns: 1fr; }
  body { background: white; }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-card { display: none; }
  .calc-grid { grid-template-columns: 1fr; }
  .calc-sticky { position: static; }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .calculators-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  nav { display: none; }
  nav.open { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--navy); padding: 1rem; gap: 0.25rem; }
  .mobile-menu-toggle { display: block; }
  .header-inner { flex-wrap: wrap; }
  .features-grid { grid-template-columns: 1fr; }
  .calculators-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .savings-display { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .hero { padding: 2.5rem 0 3rem; }
  .hero-actions { flex-direction: column; }
  .trust-signals { flex-direction: column; gap: 0.75rem; }
}
