/* =========================================
   CGT Calculator UK — Main Stylesheet
   ========================================= */

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

:root {
  --navy: #0d1f3c;
  --navy-light: #162d55;
  --gold: #c8a84b;
  --gold-light: #e8c96e;
  --cream: #f9f6f0;
  --white: #ffffff;
  --text: #2c2c2c;
  --text-muted: #6b7280;
  --border: #e5e0d8;
  --green: #1a7a4a;
  --red: #b91c1c;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(13,31,60,0.10);
  --shadow-lg: 0 8px 48px rgba(13,31,60,0.16);
}

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

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: var(--cream);
  line-height: 1.6;
}

/* ---- NAVIGATION ---- */
nav {
  background: var(--navy);
  padding: 0 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.18);
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  color: var(--gold);
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.3px;
}

.logo span { color: var(--white); }

.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--gold); }

/* ---- HERO ---- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 60%, #1a3a6b 100%);
  padding: 64px 5% 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(200,168,75,0.12) 0%, transparent 70%);
  top: -200px; right: -100px;
  pointer-events: none;
}

.hero-badge {
  display: inline-block;
  background: rgba(200,168,75,0.18);
  color: var(--gold-light);
  border: 1px solid rgba(200,168,75,0.35);
  padding: 5px 16px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 16px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.hero h1 em { color: var(--gold); font-style: normal; }

.hero p {
  color: rgba(255,255,255,0.72);
  max-width: 560px;
  margin: 0 auto;
  font-size: 1.05rem;
}

/* ---- MAIN LAYOUT ---- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 5%; }

/* ---- CALCULATOR CARD ---- */
.calculator-wrapper {
  margin-top: -40px;
  margin-bottom: 64px;
}

.calc-card {
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.calc-header {
  background: var(--navy);
  padding: 20px 32px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.calc-header-icon {
  width: 40px; height: 40px;
  background: var(--gold);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}

.calc-header h2 {
  font-family: 'Playfair Display', serif;
  color: var(--white);
  font-size: 1.2rem;
  font-weight: 600;
}

.calc-header p { color: rgba(255,255,255,0.6); font-size: 0.82rem; }

.calc-body { padding: 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 720px) { .calc-body { grid-template-columns: 1fr; } }

.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group.full { grid-column: 1 / -1; }

label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.2px;
}

.label-hint { font-weight: 400; color: var(--text-muted); font-size: 0.78rem; }

input[type="number"], select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--cream);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

input[type="number"]:focus, select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200,168,75,0.18);
  background: var(--white);
}

.input-prefix {
  position: relative;
}

.input-prefix::before {
  content: '£';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-weight: 600;
  pointer-events: none;
  z-index: 1;
}

.input-prefix input { padding-left: 28px; }

.tax-year-note {
  grid-column: 1 / -1;
  background: rgba(200,168,75,0.08);
  border: 1px solid rgba(200,168,75,0.25);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.82rem;
  color: #7a6520;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.calc-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-primary {
  flex: 1;
  padding: 14px 24px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover { background: var(--navy-light); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  padding: 14px 20px;
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover { border-color: var(--navy); color: var(--navy); }

/* ---- RESULTS ---- */
.results-panel {
  display: none;
  border-top: 1px solid var(--border);
  padding: 32px;
}

.results-panel.visible { display: block; }

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.results-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--navy);
}

.tax-badge {
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
}

.tax-badge.no-tax { background: #dcfce7; color: #166534; }
.tax-badge.tax-due { background: #fee2e2; color: #991b1b; }

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.result-item {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 18px 20px;
  border-left: 4px solid var(--border);
}

.result-item.highlight { border-left-color: var(--gold); background: rgba(200,168,75,0.07); }
.result-item.tax-owed { border-left-color: #ef4444; background: #fef2f2; }
.result-item.tax-free { border-left-color: #22c55e; background: #f0fdf4; }

.result-label { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.result-value { font-size: 1.5rem; font-weight: 700; color: var(--navy); font-family: 'Playfair Display', serif; }

.result-item.tax-owed .result-value { color: #b91c1c; }
.result-item.tax-free .result-value { color: #15803d; }

.tax-breakdown {
  background: var(--navy);
  border-radius: var(--radius);
  padding: 20px 24px;
  color: var(--white);
}

.tax-breakdown h4 {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  margin-bottom: 14px;
  color: var(--gold-light);
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 0.88rem;
}

.breakdown-row:last-child { border-bottom: none; font-weight: 700; font-size: 0.95rem; }
.breakdown-row:last-child span:last-child { color: var(--gold); font-size: 1.1rem; }

.disclaimer {
  margin-top: 20px;
  padding: 14px 18px;
  background: rgba(13,31,60,0.05);
  border-radius: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---- INFO SECTIONS ---- */
.section { padding: 64px 0; }
.section-alt { background: var(--white); }

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--navy);
  margin-bottom: 12px;
}

.section-subtitle { color: var(--text-muted); font-size: 1rem; max-width: 560px; }

.section-head { margin-bottom: 40px; }

/* ---- RATE CARDS ---- */
.rate-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }

.rate-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--navy);
  transition: transform 0.2s, box-shadow 0.2s;
}

.rate-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.rate-card.gold { border-top-color: var(--gold); }
.rate-card.green { border-top-color: var(--green); }

.rate-card-label { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted); margin-bottom: 6px; }
.rate-card-value { font-family: 'Playfair Display', serif; font-size: 2.4rem; font-weight: 700; color: var(--navy); }
.rate-card-desc { font-size: 0.84rem; color: var(--text-muted); margin-top: 8px; line-height: 1.5; }

/* ---- FAQ ---- */
.faq-list { display: flex; flex-direction: column; gap: 12px; }

.faq-item {
  background: var(--white);
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  overflow: hidden;
}

.faq-q {
  padding: 18px 24px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--navy);
  transition: background 0.2s;
  list-style: none;
}

.faq-q:hover { background: var(--cream); }
.faq-q::marker { display: none; }

.faq-q .chevron {
  transition: transform 0.3s;
  font-size: 1rem;
  color: var(--gold);
}

details[open] .faq-q .chevron { transform: rotate(180deg); }

.faq-a {
  padding: 0 24px 18px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ---- BLOG SECTION ---- */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; }

.blog-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.blog-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }

.blog-card-img {
  height: 180px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  position: relative;
  overflow: hidden;
}

.blog-card-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(13,31,60,0.3));
}

.blog-card-body { padding: 24px; }
.blog-tag { display: inline-block; background: rgba(200,168,75,0.12); color: #7a6520; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; padding: 3px 10px; border-radius: 4px; margin-bottom: 10px; }
.blog-card-title { font-family: 'Playfair Display', serif; font-size: 1.1rem; color: var(--navy); margin-bottom: 10px; line-height: 1.4; }
.blog-card-excerpt { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 16px; }
.blog-card-meta { font-size: 0.78rem; color: var(--text-muted); display: flex; gap: 16px; }

/* ---- FOOTER ---- */
footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  padding: 48px 5% 24px;
}

.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-brand .logo { font-size: 1.2rem; margin-bottom: 12px; display: inline-block; }
.footer-brand p { font-size: 0.85rem; line-height: 1.6; max-width: 280px; }

.footer-links h4 { color: var(--white); font-size: 0.85rem; font-weight: 600; margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.5px; }
.footer-links ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: rgba(255,255,255,0.6); text-decoration: none; font-size: 0.85rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--gold); }

.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 24px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 0.8rem; }
.footer-bottom a { color: rgba(255,255,255,0.6); text-decoration: none; }
.footer-bottom a:hover { color: var(--gold); }

/* ---- UTILITY ---- */
.text-gold { color: var(--gold); }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }

/* ---- TABLE ---- */
.table-wrap { overflow-x: auto; margin-top: 20px; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
thead th { background: var(--navy); color: var(--white); padding: 12px 16px; text-align: left; font-weight: 600; }
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); }
tbody tr:nth-child(even) { background: var(--cream); }
tbody tr:hover { background: rgba(200,168,75,0.06); }

/* ---- HOW IT WORKS STEPS ---- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.step { text-align: center; padding: 28px 20px; }
.step-num { width: 52px; height: 52px; background: var(--gold); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'Playfair Display', serif; font-size: 1.4rem; color: var(--navy); font-weight: 700; margin: 0 auto 16px; }
.step h4 { font-family: 'Playfair Display', serif; color: var(--navy); margin-bottom: 8px; }
.step p { font-size: 0.85rem; color: var(--text-muted); }

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
  nav { padding: 0 4%; }
  .hero { padding: 48px 4% 72px; }
  .calc-body { padding: 20px; }
  .results-panel { padding: 20px; }
  .calc-header { padding: 16px 20px; }
  .container { padding: 0 4%; }
}

/* ---- ANIMATIONS ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-up { animation: fadeUp 0.6s ease both; }
.fade-up-1 { animation-delay: 0.1s; }
.fade-up-2 { animation-delay: 0.2s; }
.fade-up-3 { animation-delay: 0.3s; }
