/* ===== PropertyBrain.uk — Shared Styles ===== */
:root {
  --primary: #0a2540;
  --primary-light: #1a3d5c;
  --accent: #2563eb;
  --accent-light: #3b82f6;
  --green: #16a34a;
  --green-bg: #f0fdf4;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --amber: #d97706;
  --amber-bg: #fffbeb;
  --grey-50: #f8fafc;
  --grey-100: #f1f5f9;
  --grey-200: #e2e8f0;
  --grey-300: #cbd5e1;
  --grey-600: #475569;
  --grey-800: #1e293b;
  --white: #ffffff;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --radius: 8px;
  --radius-lg: 12px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: 16px; line-height: 1.6; color: var(--grey-800); background: var(--grey-50);
}
h1, h2, h3, h4 { line-height: 1.3; font-weight: 700; }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); color: var(--primary); }
h2 { font-size: clamp(1.3rem, 3vw, 1.75rem); color: var(--primary); }
h3 { font-size: 1.15rem; color: var(--primary); }
p { margin-bottom: 1rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.25rem; }

/* Layout */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
.container--narrow { max-width: 800px; margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.site-header {
  background: var(--primary); padding: 0.875rem 0;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.site-header__logo {
  font-size: 1.35rem; font-weight: 800; color: var(--white) !important;
  text-decoration: none !important; letter-spacing: -0.5px; white-space: nowrap;
}
.site-header__logo span { color: #60a5fa; }
.site-nav { display: flex; gap: 0.15rem; flex-wrap: wrap; }
.site-nav a {
  color: rgba(255,255,255,0.82); padding: 0.3rem 0.65rem; border-radius: var(--radius);
  font-size: 0.82rem; font-weight: 500; transition: background 0.15s, color 0.15s; white-space: nowrap;
}
.site-nav a:hover, .site-nav a.active {
  background: rgba(255,255,255,0.15); color: var(--white); text-decoration: none;
}

/* Page hero */
.page-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white); padding: 3rem 0 2.5rem; text-align: center;
}
.page-hero h1 { color: var(--white); font-size: clamp(1.6rem, 4vw, 2.5rem); margin-bottom: 0.75rem; }
.page-hero p { color: rgba(255,255,255,0.85); font-size: 1.05rem; margin: 0 auto; max-width: 620px; }
.breadcrumb { font-size: 0.82rem; color: rgba(255,255,255,0.6); margin-bottom: 0.6rem; }
.breadcrumb a { color: rgba(255,255,255,0.7); }

/* Main */
.main-content { padding: 2.5rem 0 3rem; }

/* Cards */
.card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 1.75rem; margin-bottom: 1.5rem;
}
.card--flush { padding: 0; overflow: hidden; }
.card__header {
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--grey-200);
  font-weight: 700; font-size: 0.95rem; color: var(--primary); background: var(--grey-50);
}
.card__body { padding: 1.5rem; }

/* Calculator layout */
.calc-layout { display: grid; grid-template-columns: 1fr 360px; gap: 1.5rem; align-items: start; }
@media (max-width: 820px) { .calc-layout { grid-template-columns: 1fr; } }

/* Form elements */
.form-group { margin-bottom: 1.1rem; }
.form-group:last-child { margin-bottom: 0; }
label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--grey-800); margin-bottom: 0.3rem; }
.hint { font-weight: 400; color: var(--grey-600); font-size: 0.8rem; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-prefix, .input-suffix {
  position: absolute; font-size: 0.9rem; color: var(--grey-600); pointer-events: none; z-index: 1;
}
.input-prefix { left: 0.75rem; }
.input-suffix { right: 0.75rem; }
input[type="number"], input[type="text"], select, textarea {
  width: 100%; padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--grey-300); border-radius: var(--radius);
  font-size: 0.95rem; color: var(--grey-800); background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  -moz-appearance: textfield; appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
input:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.has-prefix input { padding-left: 1.9rem; }
.has-suffix input { padding-right: 2.25rem; }
select { cursor: pointer; }
textarea { resize: vertical; min-height: 80px; }

/* Range */
.range-row { display: flex; align-items: center; gap: 0.75rem; }
input[type="range"] { flex: 1; accent-color: var(--accent); cursor: pointer; height: 4px; }
.range-display { font-size: 0.9rem; font-weight: 700; color: var(--accent); min-width: 3.5rem; text-align: right; white-space: nowrap; }

/* Toggle pills */
.toggle-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.toggle-pill {
  padding: 0.35rem 0.9rem; border: 1.5px solid var(--grey-300); border-radius: 2rem;
  cursor: pointer; font-size: 0.85rem; font-weight: 500; transition: all 0.15s;
  user-select: none; display: inline-block;
}
.toggle-pill.active { border-color: var(--accent); background: rgba(37,99,235,0.08); color: var(--accent); }

/* Results panel */
.results-panel {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); position: sticky; top: 4.5rem;
}
.results-panel__header {
  background: var(--primary); color: var(--white);
  padding: 0.875rem 1.5rem; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  font-weight: 700; font-size: 0.95rem;
}
.results-panel__body { padding: 1.25rem 1.5rem; }
.result-hero {
  text-align: center; padding: 1.1rem 0.75rem; margin-bottom: 0.75rem;
  border-radius: var(--radius); background: var(--grey-50); border: 1px solid var(--grey-200);
}
.result-hero__label {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--grey-600); margin-bottom: 0.2rem;
}
.result-hero__value { font-size: 1.9rem; font-weight: 800; color: var(--primary); }
.result-hero__value.positive { color: var(--green); }
.result-hero__value.negative { color: var(--red); }
.result-hero__sub { font-size: 0.8rem; color: var(--grey-600); margin-top: 0.1rem; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-bottom: 0.75rem; }
.result-mini {
  background: var(--grey-50); border-radius: var(--radius); padding: 0.6rem 0.75rem;
  border: 1px solid var(--grey-200);
}
.result-mini__label { font-size: 0.72rem; color: var(--grey-600); font-weight: 600; margin-bottom: 0.1rem; }
.result-mini__value { font-size: 1.05rem; font-weight: 700; color: var(--grey-800); }
.result-mini__value.positive { color: var(--green); }
.result-mini__value.negative { color: var(--red); }
.result-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 0.45rem 0; border-bottom: 1px solid var(--grey-200); gap: 0.75rem;
}
.result-row:last-child { border-bottom: none; }
.result-row__label { font-size: 0.85rem; color: var(--grey-600); }
.result-row__value { font-size: 0.95rem; font-weight: 700; color: var(--grey-800); text-align: right; }
.result-row__value.positive { color: var(--green); }
.result-row__value.negative { color: var(--red); }
.result-row__value.accent { color: var(--accent); }
.result-divider { height: 1px; background: var(--grey-200); margin: 0.5rem 0; }

/* Tabs */
.tab-group { }
.tabs { border-bottom: 2px solid var(--grey-200); margin-bottom: 1.5rem; display: flex; gap: 0; overflow-x: auto; }
.tab-btn {
  padding: 0.65rem 1.1rem; font-size: 0.875rem; font-weight: 600; color: var(--grey-600);
  background: none; border: none; border-bottom: 3px solid transparent;
  margin-bottom: -2px; cursor: pointer; transition: color 0.15s, border-color 0.15s; white-space: nowrap;
}
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-btn:hover:not(.active) { color: var(--grey-800); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--grey-200); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th {
  background: var(--grey-100); padding: 0.55rem 0.875rem;
  text-align: left; font-weight: 700; color: var(--grey-800); white-space: nowrap;
}
.data-table td { padding: 0.55rem 0.875rem; border-bottom: 1px solid var(--grey-200); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--grey-50); }
.data-table .positive { color: var(--green); font-weight: 600; }
.data-table .negative { color: var(--red); font-weight: 600; }
.data-table .total-row td { font-weight: 700; background: var(--grey-50); }

/* CTA box */
.cta-box {
  background: linear-gradient(135deg, #0a2540 0%, #1e3a5f 100%);
  color: var(--white); border-radius: var(--radius-lg);
  padding: 2.5rem 2rem; text-align: center; margin: 2.5rem 0;
}
.cta-box h2 { color: var(--white); font-size: 1.4rem; margin-bottom: 0.6rem; }
.cta-box p { color: rgba(255,255,255,0.82); margin-bottom: 1.5rem; font-size: 0.95rem; }
.cta-box .cta-stats { display: flex; justify-content: center; gap: 2rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.cta-box .cta-stat__n { font-size: 1.6rem; font-weight: 800; color: #60a5fa; display: block; }
.cta-box .cta-stat__label { font-size: 0.8rem; color: rgba(255,255,255,0.7); }
.btn {
  display: inline-block; padding: 0.75rem 2rem; border-radius: 2rem; font-weight: 700;
  font-size: 0.95rem; transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer; border: none; text-decoration: none !important;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.btn--primary { background: var(--accent); color: var(--white); }
.btn--green { background: var(--green); color: var(--white); font-size: 1.05rem; padding: 0.875rem 2.25rem; }
.btn--outline { background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,0.6); }
.btn--sm { padding: 0.45rem 1.25rem; font-size: 0.85rem; }

/* Notice */
.notice {
  background: var(--amber-bg); border-left: 4px solid var(--amber);
  padding: 0.75rem 1.1rem; border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.875rem; color: #78350f; margin-bottom: 1.25rem;
}
.notice a { color: #92400e; font-weight: 600; }

/* FAQ */
.faq-section { margin: 3rem 0; }
.faq-section h2 { margin-bottom: 1.25rem; }
details.faq-item {
  border: 1px solid var(--grey-200); border-radius: var(--radius);
  margin-bottom: 0.625rem; overflow: hidden;
}
details.faq-item summary {
  padding: 0.875rem 1.1rem; font-weight: 600; font-size: 0.925rem;
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center;
  background: var(--white); color: var(--primary);
}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::after { content: '+'; font-size: 1.15rem; color: var(--accent); flex-shrink: 0; }
details.faq-item[open] summary::after { content: '−'; }
details.faq-item[open] summary { background: var(--grey-50); }
.faq-body { padding: 0.875rem 1.1rem; font-size: 0.9rem; color: var(--grey-600); border-top: 1px solid var(--grey-200); }
.faq-body p:last-child { margin-bottom: 0; }

/* Downloads */
.downloads-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.25rem; }
.download-card {
  background: var(--white); border: 1px solid var(--grey-200); border-radius: var(--radius-lg);
  padding: 1.5rem; text-align: center; transition: box-shadow 0.2s, transform 0.2s;
}
.download-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.download-card__icon { font-size: 2.5rem; margin-bottom: 0.75rem; line-height: 1; }
.download-card__title { font-weight: 700; color: var(--primary); margin-bottom: 0.3rem; font-size: 1rem; }
.download-card__desc { font-size: 0.85rem; color: var(--grey-600); margin-bottom: 1.25rem; }
.btn--download { background: #16a34a; color: var(--white); }

/* Calc cards grid */
.calc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.1rem; }
.calc-card {
  background: var(--white); border: 1px solid var(--grey-200); border-radius: var(--radius-lg);
  padding: 1.4rem; transition: box-shadow 0.2s, transform 0.2s;
  text-decoration: none !important; color: inherit; display: block;
}
.calc-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }
.calc-card__icon { font-size: 1.9rem; margin-bottom: 0.6rem; line-height: 1; }
.calc-card__title { font-weight: 700; color: var(--primary); margin-bottom: 0.25rem; font-size: 0.95rem; }
.calc-card__desc { font-size: 0.82rem; color: var(--grey-600); margin: 0; }

/* Section heading */
.section-header { margin-bottom: 1.75rem; text-align: center; }
.section-header h2 { margin-bottom: 0.4rem; }
.section-header p { color: var(--grey-600); max-width: 540px; margin: 0 auto; font-size: 0.95rem; }

/* Ad slot */
.ad-slot {
  background: var(--grey-100); border: 1px dashed var(--grey-300); border-radius: var(--radius);
  text-align: center; padding: 1.5rem; font-size: 0.8rem; color: var(--grey-600); margin: 1.5rem 0;
  min-height: 90px; display: flex; align-items: center; justify-content: center;
}

/* Footer */
.site-footer { background: var(--primary); color: rgba(255,255,255,0.75); padding: 3rem 0 1.5rem; margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2.5rem; margin-bottom: 2rem; }
@media (max-width: 640px) { .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; } }
.footer-brand__name { font-size: 1.15rem; font-weight: 800; color: var(--white); margin-bottom: 0.4rem; }
.footer-brand__name span { color: #60a5fa; }
.footer-brand p { font-size: 0.85rem; margin-bottom: 0; }
.footer-links h4 { color: var(--white); font-size: 0.8rem; font-weight: 700; margin-bottom: 0.65rem; text-transform: uppercase; letter-spacing: 0.06em; }
.footer-links ul { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.35rem; }
.footer-links a { color: rgba(255,255,255,0.62); font-size: 0.85rem; }
.footer-links a:hover { color: var(--white); text-decoration: none; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1.25rem;
  font-size: 0.78rem; color: rgba(255,255,255,0.48);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem;
}
.footer-bottom a { color: #93c5fd; }

/* Cookie banner */
#cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; background: #1e293b;
  color: var(--white); padding: 0.875rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  z-index: 9999; box-shadow: 0 -4px 16px rgba(0,0,0,0.25); flex-wrap: wrap;
}
#cookie-banner p { font-size: 0.85rem; color: rgba(255,255,255,0.82); margin: 0; }
#cookie-banner a { color: #93c5fd; }
.cookie-btns { display: flex; gap: 0.6rem; flex-shrink: 0; }
.btn-cookie-accept {
  background: var(--green); color: var(--white); border: none;
  padding: 0.45rem 1.1rem; border-radius: 2rem; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.btn-cookie-decline {
  background: transparent; color: rgba(255,255,255,0.72);
  border: 1px solid rgba(255,255,255,0.35);
  padding: 0.45rem 1.1rem; border-radius: 2rem; font-size: 0.85rem; cursor: pointer;
}

/* Two-col text layout */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; } }

/* Stress test bar */
.stress-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.4rem 0; font-size: 0.875rem; }
.stress-bar-wrap { flex: 1; background: var(--grey-200); border-radius: 99px; height: 8px; overflow: hidden; }
.stress-bar { height: 100%; border-radius: 99px; transition: width 0.3s; }
.stress-bar.ok { background: var(--green); }
.stress-bar.warn { background: var(--amber); }
.stress-bar.bad { background: var(--red); }
.stress-label { min-width: 2.5rem; font-size: 0.8rem; color: var(--grey-600); }
.stress-value { min-width: 4rem; text-align: right; font-weight: 600; }

/* Highlight pill */
.pill {
  display: inline-block; padding: 0.15rem 0.65rem; border-radius: 99px;
  font-size: 0.75rem; font-weight: 700; line-height: 1.6;
}
.pill--green { background: var(--green-bg); color: var(--green); }
.pill--red { background: var(--red-bg); color: var(--red); }
.pill--amber { background: var(--amber-bg); color: var(--amber); }
.pill--blue { background: rgba(37,99,235,0.08); color: var(--accent); }

/* Helper */
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.text-sm { font-size: 0.875rem; } .text-xs { font-size: 0.8rem; } .text-muted { color: var(--grey-600); }
.text-center { text-align: center; } .font-bold { font-weight: 700; }
.positive { color: var(--green); } .negative { color: var(--red); }
.hidden { display: none !important; }

@media (max-width: 640px) {
  .card { padding: 1.1rem; }
  .results-panel { position: static; }
  .page-hero { padding: 2rem 0 1.75rem; }
  .main-content { padding: 1.5rem 0 2rem; }
}
