/* ============================================
   HH UK / mortgagecalcuk.com
   Brand: Hall's Homes UK
   Fonts: Playfair Display (display) + DM Sans (body)
   ============================================ */

/* --- THEME VARIABLES --- */
:root {
  /* Light theme (default) */
  --bg: #faf8f4;
  --bg-elev: #ffffff;
  --bg-soft: #f4f0e8;
  --text: #1a1a1a;
  --text-soft: #5a5a5a;
  --text-mute: #8a8a8a;
  --border: #e2ddd4;
  --border-strong: #c9c2b3;
  --navy: #0f1923;
  --gold: #b8963e;
  --gold-light: #d4af6a;
  --gold-soft: rgba(184, 150, 62, 0.08);
  --accent: var(--gold);
  --accent-text: var(--navy);
  --shadow-sm: 0 1px 2px rgba(15, 25, 35, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 25, 35, 0.06);
  --shadow-lg: 0 12px 32px rgba(15, 25, 35, 0.08);
}

[data-theme="dark"] {
  /* Cold dark theme */
  --bg: #0f1923;
  --bg-elev: #182434;
  --bg-soft: #1f2d40;
  --text: #f4f0e8;
  --text-soft: #c9c2b3;
  --text-mute: #8a8a8a;
  --border: #2a3a52;
  --border-strong: #3a4d6b;
  --navy: #0f1923;
  --gold: #d4af6a;
  --gold-light: #e2c389;
  --gold-soft: rgba(212, 175, 106, 0.1);
  --accent: var(--gold);
  --accent-text: var(--navy);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
}

/* --- RESET & BASE --- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'DM Sans', -apple-system, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p { margin: 0 0 1em; }

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--gold-light);
  text-decoration: underline;
}

/* --- LAYOUT --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- HEADER / NAV --- */
header {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

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

.brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.brand .accent {
  color: var(--gold);
}

.brand a {
  color: inherit;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--text-soft);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--gold);
  text-decoration: none;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-soft);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-size: 1rem;
}

.theme-toggle:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* --- HERO --- */
.hero {
  padding: 3rem 1.5rem 2rem;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero .eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 0.75rem;
}

.hero p {
  font-size: 1.05rem;
  color: var(--text-soft);
  max-width: 540px;
  margin: 0 auto;
}

/* --- JOURNEY BUTTON --- */
.journey-bar {
  text-align: center;
  margin: 1.5rem auto 1rem;
  padding: 0 1.5rem;
}

.journey-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  background: var(--navy);
  color: #faf8f4;
  border: none;
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .journey-toggle {
  background: var(--gold);
  color: var(--navy);
}

.journey-toggle:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.journey-toggle.active {
  background: var(--gold);
  color: var(--navy);
}

.journey-toggle .icon {
  font-size: 1rem;
}

/* --- CALCULATOR PILLS --- */
.calc-pills-wrap {
  margin: 1.5rem 0 0;
  padding: 0;
  position: relative;
}

.calc-pills {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 1.5rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  max-width: 1100px;
  margin: 0 auto;
}

.calc-pills::-webkit-scrollbar {
  display: none;
}

.pill {
  flex-shrink: 0;
  padding: 0.6rem 1.1rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-soft);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.pill:hover {
  border-color: var(--gold);
  color: var(--text);
}

.pill.active {
  background: var(--navy);
  color: #faf8f4;
  border-color: var(--navy);
}

[data-theme="dark"] .pill.active {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}

/* mobile scroll fade indicator */
@media (max-width: 720px) {
  .calc-pills-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 32px;
    height: 100%;
    background: linear-gradient(to right, transparent, var(--bg));
    pointer-events: none;
  }
}

/* --- CALCULATOR PANEL --- */
.calculator {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  margin: 2rem auto;
  max-width: 1100px;
  box-shadow: var(--shadow-md);
}

.calc-section {
  display: none;
}

.calc-section.active {
  display: block;
}

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

@media (max-width: 720px) {
  .calc-grid {
    grid-template-columns: 1fr;
  }
  .calculator {
    padding: 1.25rem;
    margin: 1rem;
  }
}

.calc-inputs {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.calc-results {
  background: var(--bg-soft);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 280px;
}

.calc-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  margin-bottom: 0.25rem;
}

.calc-subtitle {
  color: var(--text-mute);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* --- FORM ELEMENTS --- */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.field label .value-display {
  color: var(--gold);
  font-weight: 600;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: 1rem;
  color: var(--text-mute);
  font-weight: 500;
  pointer-events: none;
  font-size: 1rem;
}

.input-suffix {
  position: absolute;
  right: 1rem;
  color: var(--text-mute);
  font-weight: 500;
  pointer-events: none;
  font-size: 0.95rem;
}

input[type="number"], input[type="text"], select {
  width: 100%;
  padding: 0.7rem 1rem 0.7rem 2rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  transition: all 0.2s;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input.no-prefix {
  padding-left: 1rem;
}

input.with-suffix {
  padding-right: 2.5rem;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  padding: 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--gold);
  border-radius: 50%;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--gold);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

select {
  padding: 0.7rem 1rem;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3e%3cpath fill='%238a8a8a' d='M6 8L0 0h12z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.btn {
  padding: 0.85rem 1.5rem;
  background: var(--navy);
  color: #faf8f4;
  border: none;
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

[data-theme="dark"] .btn {
  background: var(--gold);
  color: var(--navy);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary {
  background: var(--gold);
  color: var(--navy);
}

.btn-primary:hover {
  background: var(--gold-light);
}

/* --- RESULTS DISPLAY --- */
.result-main {
  text-align: center;
  margin-bottom: 1.5rem;
}

.result-label {
  font-size: 0.85rem;
  color: var(--text-mute);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.result-value {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 600;
  color: var(--gold);
  line-height: 1;
}

.result-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.result-item {
  text-align: center;
}

.result-item .label {
  font-size: 0.75rem;
  color: var(--text-mute);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.result-item .val {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.result-empty {
  text-align: center;
  color: var(--text-mute);
  font-style: italic;
  padding: 2rem 0;
}

/* --- CONTEXT CARD ("what this means") --- */
.context-card {
  background: var(--gold-soft);
  border-left: 3px solid var(--gold);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 6px 6px 0;
}

.context-card .label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.context-card p {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* --- SUPPORTING CONTENT --- */
.calc-supporting {
  max-width: 760px;
  margin: 2.5rem auto;
  padding: 0 1.5rem;
}

.calc-supporting h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  margin: 1.5rem 0 0.5rem;
}

.calc-supporting h4 {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin: 1.25rem 0 0.3rem;
  color: var(--text);
}

.calc-supporting p {
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* --- JOURNEY SUMMARY --- */
.journey-summary {
  background: var(--navy);
  color: #faf8f4;
  padding: 2.5rem 2rem;
  border-radius: 12px;
  margin: 2rem auto;
  max-width: 1100px;
  display: none;
}

[data-theme="dark"] .journey-summary {
  background: var(--bg-elev);
  border: 1px solid var(--gold);
}

.journey-summary.active {
  display: block;
}

.journey-summary h2 {
  color: #faf8f4;
  font-family: 'Playfair Display', serif;
  text-align: center;
  margin-bottom: 0.5rem;
}

[data-theme="dark"] .journey-summary h2 {
  color: var(--gold);
}

.journey-summary > p {
  text-align: center;
  color: rgba(250, 248, 244, 0.7);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

[data-theme="dark"] .journey-summary > p {
  color: var(--text-soft);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

@media (max-width: 720px) {
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.summary-card {
  background: rgba(250, 248, 244, 0.06);
  border: 1px solid rgba(212, 175, 106, 0.2);
  padding: 1.25rem;
  border-radius: 8px;
  text-align: center;
}

[data-theme="dark"] .summary-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
}

.summary-card .label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 0.6rem;
}

.summary-card .val {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #faf8f4;
}

[data-theme="dark"] .summary-card .val {
  color: var(--text);
}

/* --- JOURNEY PROMPT (auto-suggestion) --- */
.journey-prompt {
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.5rem auto;
  max-width: 1100px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.journey-prompt.show {
  display: flex;
}

@media (max-width: 720px) {
  .journey-prompt {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
}

.journey-prompt .text {
  font-size: 0.95rem;
  color: var(--text);
}

.journey-prompt strong {
  color: var(--gold);
}

.journey-prompt button {
  flex-shrink: 0;
}

/* --- TABLE (breakdown) --- */
.breakdown-table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
}

.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.breakdown-table th {
  background: var(--bg-soft);
  text-align: left;
  padding: 0.6rem 1rem;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.breakdown-table td {
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-soft);
}

.breakdown-table tr:hover td {
  background: var(--bg-soft);
}

.breakdown-toggle {
  background: none;
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  color: var(--text-soft);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  margin-top: 1rem;
}

.breakdown-toggle:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* --- FOOTER --- */
footer {
  background: var(--navy);
  color: #c9c2b3;
  padding: 3rem 1.5rem 2rem;
  margin-top: 4rem;
}

[data-theme="dark"] footer {
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 720px) {
  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

footer h4 {
  color: #faf8f4;
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

[data-theme="dark"] footer h4 {
  color: var(--text);
}

footer p, footer a {
  font-size: 0.85rem;
  color: #c9c2b3;
  line-height: 1.7;
}

[data-theme="dark"] footer p,
[data-theme="dark"] footer a {
  color: var(--text-soft);
}

footer a:hover {
  color: var(--gold-light);
}

.footer-disclaimer {
  max-width: 1100px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(184, 150, 62, 0.2);
  font-size: 0.75rem;
  color: rgba(201, 194, 179, 0.7);
  text-align: center;
  line-height: 1.6;
}

[data-theme="dark"] .footer-disclaimer {
  border-top: 1px solid var(--border);
  color: var(--text-mute);
}

/* --- GUIDE PAGE --- */
.guide-hero {
  padding: 3rem 1.5rem 2rem;
  max-width: 760px;
  margin: 0 auto;
}

.guide-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 0.5rem;
}

.guide-hero .meta {
  color: var(--text-mute);
  font-size: 0.9rem;
}

.guide-toc {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem auto;
  max-width: 760px;
}

.guide-toc h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 0.75rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
}

.guide-toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-toc li {
  margin: 0.4rem 0;
}

.guide-toc a {
  color: var(--text);
  font-size: 0.95rem;
}

.guide-toc a:hover {
  color: var(--gold);
  text-decoration: none;
}

.guide-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

.guide-body h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.65rem;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--gold);
  scroll-margin-top: 80px;
}

.guide-body h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  margin: 1.5rem 0 0.5rem;
}

.guide-body p {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.75;
}

.guide-body ul {
  margin: 1rem 0 1.25rem 1.5rem;
}

.guide-body li {
  margin-bottom: 0.4rem;
  line-height: 1.65;
}

.guide-body strong {
  color: var(--text);
  font-weight: 600;
}

.guide-body .disclaimer-block {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 2.5rem 0 1.5rem;
  font-size: 0.85rem;
  color: var(--text-soft);
  line-height: 1.65;
}

.guide-body .disclaimer-block strong {
  color: var(--text);
}
