/* ==========================================================================
   CalculatorHub - Modern, Responsive Stylesheet
   Design Direction: Clean light background, professional, spacious, subtle borders
   ========================================================================== */

/* --- CSS Variables & Design Tokens --- */
:root {
  /* Brand Colors */
  --primary: #2563eb;          /* Vibrant, trustworthy primary blue */
  --primary-hover: #1d4ed8;    /* Darker blue for hover states */
  --primary-light: #eff6ff;    /* Soft blue tint for icons and badges */
  --primary-ring: rgba(37, 99, 235, 0.25);

  /* Neutrals & Surfaces */
  --bg-page: #f8fafc;          /* Slate 50 - clean light page background */
  --bg-surface: #ffffff;       /* Pure white card and container surface */
  --bg-subtle: #f1f5f9;        /* Slate 100 - subtle background for tags/inputs */
  --bg-hover: #f8fafc;

  /* Typography Colors */
  --text-main: #0f172a;        /* Slate 900 - high contrast headline text */
  --text-body: #334155;        /* Slate 700 - readable body text */
  --text-muted: #64748b;       /* Slate 500 - descriptions, labels, hints */
  --text-subtle: #94a3b8;      /* Slate 400 - placeholders, borders */

  /* Borders & Dividers */
  --border-color: #e2e8f0;     /* Slate 200 - clean subtle borders */
  --border-focus: #2563eb;

  /* Accents & Status */
  --accent-green: #10b981;
  --accent-green-light: #ecfdf5;
  --accent-amber: #f59e0b;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-card-hover: 0 12px 20px -3px rgba(37, 99, 235, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-body);
  background-color: var(--bg-page);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text-body);
  background-color: var(--bg-page);
  overflow-x: hidden;
  max-width: 100%;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

button, input, select {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* --- Layout Container --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

@media (min-width: 768px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* --- Section Spacing --- */
.section {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

@media (max-width: 640px) {
  .section {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 2.5rem auto;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  background-color: var(--primary-light);
  color: var(--primary);
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  margin-bottom: 0.875rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

@media (max-width: 640px) {
  .section-title {
    font-size: 1.625rem;
  }
}

.section-description {
  font-size: 1.0625rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* --- Header & Navigation --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-main);
  text-decoration: none;
  flex-shrink: 0;
}

.brand-icon-wrapper {
  width: 2.375rem;
  height: 2.375rem;
  background-color: var(--primary);
  color: #ffffff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
  flex-shrink: 0;
}

.brand-icon-wrapper svg {
  width: 1.35rem;
  height: 1.35rem;
}

.brand-text-wrapper {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  line-height: 1.15;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand-name span {
  color: var(--primary);
}

.brand-tagline-sub {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.nav-menu {
  display: none;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
}

.nav-link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-body);
  padding: 0.5rem 0.25rem;
  position: relative;
  transition: color var(--transition-fast);
  white-space: nowrap;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--primary);
}

.nav-link.active {
  color: var(--primary);
  font-weight: 600;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0.25rem;
  right: 0.25rem;
  height: 2px;
  background-color: var(--primary);
  border-radius: var(--radius-full);
}

.nav-actions {
  display: none;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-md);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  transition: all var(--transition-fast);
  flex-shrink: 0;
  cursor: pointer;
  padding: 0;
}

.mobile-menu-btn:hover,
.mobile-menu-btn:focus-visible {
  background-color: var(--bg-subtle);
  border-color: var(--text-subtle);
}

.mobile-menu-btn[aria-expanded="true"] {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: #bfdbfe;
}

/* Mobile Nav Drawer */
.mobile-nav {
  display: none;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem;
}

.mobile-nav.is-open {
  display: block;
}

.mobile-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-body);
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.mobile-nav-link:hover,
.mobile-nav-link:focus-visible {
  background-color: var(--primary-light);
  color: var(--primary);
}

.mobile-nav-link.active {
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

/* Hide brand tagline in sticky header on mobile screens to keep [Logo] [☰] clean and prevent overflow */
@media (max-width: 640px) {
  .site-header .brand-tagline-sub {
    display: none !important;
  }
}

/* Ultra-compact screens (320px - 360px) */
@media (max-width: 360px) {
  .container {
    padding-left: 0.875rem;
    padding-right: 0.875rem;
  }
  .site-header .brand-logo {
    gap: 0.5rem;
    font-size: 1.125rem;
  }
  .site-header .brand-icon-wrapper {
    width: 2.125rem;
    height: 2.125rem;
  }
}

/* Mobile & Tablet nav display (< 992px) */
@media (max-width: 991px) {
  .nav-menu {
    display: none !important;
  }
  .nav-actions {
    display: none !important;
  }
  .mobile-menu-btn {
    display: flex !important;
  }
}

/* Desktop navigation display (>= 992px) */
@media (min-width: 992px) {
  .nav-menu {
    display: flex;
    gap: 1.25rem;
  }
  .nav-actions {
    display: flex;
  }
  .mobile-menu-btn {
    display: none !important;
  }
  .mobile-nav {
    display: none !important;
  }
}

/* Tablet landscape & compact desktop (992px - 1100px) */
@media (min-width: 992px) and (max-width: 1100px) {
  .site-header .brand-tagline-sub {
    display: none;
  }
  .nav-menu {
    gap: 1rem;
  }
  .nav-link {
    font-size: 0.875rem;
  }
}

/* Wide Desktop (>= 1120px) */
@media (min-width: 1120px) {
  .nav-menu {
    gap: 1.75rem;
  }
}

/* --- Hero Section --- */
.hero-section {
  padding-top: 4.5rem;
  padding-bottom: 4.5rem;
  background: radial-gradient(circle at 50% -20%, rgba(37, 99, 235, 0.08) 0%, transparent 70%);
  text-align: center;
  position: relative;
}

@media (max-width: 640px) {
  .hero-section {
    padding-top: 3rem;
    padding-bottom: 3.5rem;
  }
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.95rem;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.hero-pill-badge {
  background-color: var(--accent-green-light);
  color: var(--accent-green);
  font-size: 0.6875rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 3.375rem;
  }
}

@media (max-width: 640px) {
  .hero-title {
    font-size: 2.125rem;
  }
}

.hero-title .highlight {
  color: var(--primary);
  position: relative;
  display: inline-block;
}

.hero-description {
  font-size: 1.1875rem;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 2.25rem auto;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .hero-description {
    font-size: 1rem;
  }
}

/* Search Box Container */
.search-container {
  max-width: 640px;
  margin: 0 auto 1.5rem auto;
}

.search-bar-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background-color: #ffffff;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 0.35rem 0.5rem 0.35rem 1.25rem;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
}

.search-bar-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-ring), var(--shadow-lg);
}

.search-icon {
  color: var(--text-subtle);
  width: 1.35rem;
  height: 1.35rem;
  flex-shrink: 0;
  margin-right: 0.75rem;
}

.search-input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 1.0625rem;
  color: var(--text-main);
  outline: none;
  padding: 0.5rem 0;
}

.search-input::placeholder {
  color: var(--text-subtle);
}

.search-clear-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  background-color: var(--bg-subtle);
  margin-right: 0.5rem;
  transition: all var(--transition-fast);
}

.search-clear-btn:hover {
  background-color: var(--border-color);
  color: var(--text-main);
}

.search-clear-btn.is-active {
  display: flex;
}

.search-submit-btn {
  background-color: var(--primary);
  color: #ffffff;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
  white-space: nowrap;
}

.search-submit-btn:hover,
.search-submit-btn:focus-visible {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.search-submit-btn:active {
  transform: translateY(0);
}

@media (max-width: 480px) {
  .search-submit-btn {
    padding: 0.65rem 0.85rem;
  }
  .search-submit-btn span {
    display: none;
  }
}

.btn-header-home {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 600;
  background-color: var(--bg-subtle);
  color: var(--text-body);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-header-home:hover {
  background-color: #e2e8f0;
  color: var(--text-main);
}

/* Popular Suggestions */
.search-suggestions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.suggestions-label {
  color: var(--text-muted);
  font-weight: 500;
}

.suggestion-chip {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-body);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.suggestion-chip:hover,
.suggestion-chip:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--primary-light);
  transform: translateY(-1px);
}

/* Search Status / Empty State */
.search-results-feedback {
  display: none;
  margin-top: 1.5rem;
  padding: 0.85rem 1.25rem;
  background-color: var(--bg-surface);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  font-size: 0.9375rem;
  color: var(--text-muted);
  text-align: center;
}

.search-results-feedback.is-visible {
  display: block;
}

.search-results-feedback strong {
  color: var(--text-main);
}

/* --- Cards Grid: Popular Calculators --- */
.calculators-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .calculators-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .calculators-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
  }
}

/* Reusable Calculator Card */
.calc-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.625rem;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  position: relative;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
}

.calc-card:hover,
.calc-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: var(--shadow-card-hover);
}

.calc-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.125rem;
}

.calc-icon-box {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-md);
  background-color: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.calc-card:hover .calc-icon-box {
  background-color: var(--primary);
  color: #ffffff;
  transform: scale(1.04);
}

.calc-icon-box svg {
  width: 1.5rem;
  height: 1.5rem;
}

.calc-category-tag {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background-color: var(--bg-subtle);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
}

.calc-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.calc-card-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.calc-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
}

.calc-card-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: gap var(--transition-fast);
}

.calc-card:hover .calc-card-action {
  gap: 0.65rem;
}

.calc-card-action svg {
  width: 1rem;
  height: 1rem;
  transition: transform var(--transition-fast);
}

.calc-card:hover .calc-card-action svg {
  transform: translateX(3px);
}

/* --- Featured Calculator Preview Section --- */
.featured-section {
  background-color: #ffffff;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.featured-wrapper {
  background: linear-gradient(180deg, #ffffff 0%, var(--bg-page) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-width: 1040px;
  margin: 0 auto;
}

.featured-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color);
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.featured-badge-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.featured-label {
  background-color: var(--primary);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
}

.featured-calc-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-main);
}

.featured-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.featured-body {
  display: grid;
  grid-template-columns: 1fr;
  padding: 2rem;
  gap: 2rem;
}

@media (min-width: 860px) {
  .featured-body {
    grid-template-columns: 1.1fr 0.9fr;
    padding: 2.5rem;
    gap: 3rem;
  }
}

@media (max-width: 640px) {
  .featured-header {
    padding: 1.25rem;
  }
  .featured-body {
    padding: 1.25rem;
    gap: 1.75rem;
  }
}

/* Form Preview Side */
.featured-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-value-badge {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--primary);
  background-color: var(--primary-light);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-sm);
}

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

.input-prefix,
.input-suffix {
  position: absolute;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
}

.input-prefix {
  left: 1rem;
}

.input-suffix {
  right: 1rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-main);
  transition: all var(--transition-fast);
}

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

.input-has-suffix {
  padding-right: 2.75rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

/* Range Slider */
.form-range {
  width: 100%;
  height: 6px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  margin-top: 0.25rem;
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.form-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.range-min-max {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-subtle);
  margin-top: 0.25rem;
}

/* Prominent Calculate Button */
.btn-calculate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.95rem 1.5rem;
  background-color: var(--primary);
  color: #ffffff;
  font-size: 1.0625rem;
  font-weight: 700;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all var(--transition-fast);
  margin-top: 0.5rem;
}

.btn-calculate:hover,
.btn-calculate:focus-visible {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-calculate:active {
  transform: translateY(0);
}

.btn-calculate svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Result Preview Side */
.featured-results {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.results-top {
  display: flex;
  flex-direction: column;
}

.results-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.results-heading {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.results-badge-live {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-green);
  background-color: var(--accent-green-light);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-green);
}

.main-result-box {
  background-color: var(--primary-light);
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.main-result-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.main-result-amount {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.main-result-period {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Result Rows */
.result-stats-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.result-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed var(--border-color);
  font-size: 0.9375rem;
}

.result-stat-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.stat-label {
  color: var(--text-muted);
}

.stat-value {
  font-weight: 700;
  color: var(--text-main);
}

/* Ratio Bar */
.breakdown-bar-wrapper {
  margin-top: 0.5rem;
}

.breakdown-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.legend-dot.principal {
  background-color: var(--primary);
}

.legend-dot.interest {
  background-color: #93c5fd;
}

.breakdown-bar {
  display: flex;
  height: 8px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background-color: var(--bg-subtle);
}

.bar-segment.principal {
  width: 48%;
  background-color: var(--primary);
}

.bar-segment.interest {
  width: 52%;
  background-color: #93c5fd;
}

.results-footer-note {
  margin-top: 1.25rem;
  font-size: 0.75rem;
  color: var(--text-subtle);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

/* --- Browse by Category Section --- */
.category-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .category-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
  }
}

/* Reusable Category Card */
.category-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.category-card:hover,
.category-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: var(--shadow-card-hover);
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.category-icon-box {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: var(--radius-md);
  background-color: var(--bg-subtle);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.category-card:hover .category-icon-box {
  background-color: var(--primary-light);
  color: var(--primary);
}

.category-icon-box svg {
  width: 1.65rem;
  height: 1.65rem;
}

.category-count {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  background-color: var(--primary-light);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.category-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.category-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.category-link-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: gap var(--transition-fast);
}

.category-card:hover .category-link-text {
  gap: 0.6rem;
}

.category-link-text svg {
  width: 0.95rem;
  height: 0.95rem;
}

/* --- Why CalculatorHub Section --- */
.why-section {
  background-color: #ffffff;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

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

@media (min-width: 640px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 1.25rem;
  }
}

.feature-card {
  background-color: var(--bg-page);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all var(--transition-normal);
}

.feature-card:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.3);
  background-color: #ffffff;
  box-shadow: var(--shadow-md);
}

.feature-icon-wrapper {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.feature-card:hover .feature-icon-wrapper {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.feature-icon-wrapper svg {
  width: 1.65rem;
  height: 1.65rem;
}

.feature-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.feature-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

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

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast);
}

.faq-item.is-expanded {
  border-color: rgba(37, 99, 235, 0.4);
}

.faq-trigger {
  width: 100%;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  text-align: left;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-main);
  background-color: transparent;
  transition: background-color var(--transition-fast);
}

.faq-trigger:hover,
.faq-trigger:focus-visible {
  background-color: var(--bg-page);
  color: var(--primary);
}

.faq-chevron {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform var(--transition-normal), color var(--transition-fast);
}

.faq-item.is-expanded .faq-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
  padding: 0 1.5rem;
}

.faq-item.is-expanded .faq-content {
  max-height: 500px;
  transition: max-height 0.3s ease-in-out;
}

.faq-body {
  padding-bottom: 1.25rem;
  font-size: 0.9375rem;
  color: var(--text-body);
  line-height: 1.65;
}

/* --- Call To Action Banner --- */
.cta-banner {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
  border-radius: var(--radius-xl);
  padding: 3rem 2rem;
  color: #ffffff;
  text-align: center;
  margin-top: 2rem;
  box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.35);
}

@media (max-width: 640px) {
  .cta-banner {
    padding: 2.25rem 1.25rem;
  }
}

.cta-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

@media (max-width: 640px) {
  .cta-title {
    font-size: 1.625rem;
  }
}

.cta-desc {
  font-size: 1.0625rem;
  color: #dbeafe;
  max-width: 580px;
  margin: 0 auto 1.75rem auto;
  line-height: 1.6;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #ffffff;
  color: var(--primary);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-fast);
}

.cta-button:hover,
.cta-button:focus-visible {
  background-color: #f8fafc;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* --- Footer --- */
.site-footer {
  background-color: #ffffff;
  border-top: 1px solid var(--border-color);
  padding-top: 4rem;
  padding-bottom: 2.5rem;
  margin-top: auto;
}

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

@media (min-width: 768px) {
  .footer-top {
    grid-template-columns: 1.8fr 1fr 1fr 1fr;
  }
}

.footer-brand {
  max-width: 340px;
}

.footer-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 1rem;
  margin-bottom: 1.25rem;
}

.footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-trust-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-body);
  background-color: var(--bg-page);
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.footer-heading {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
}

.footer-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-link {
  font-size: 0.9375rem;
  color: var(--text-muted);
  transition: color var(--transition-fast), padding-left var(--transition-fast);
  display: inline-block;
}

.footer-link:hover,
.footer-link:focus-visible {
  color: var(--primary);
  padding-left: 0.25rem;
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-legal-links {
  display: flex;
  gap: 1.25rem;
}

.footer-legal-links a:hover {
  color: var(--primary);
}

/* --- Accessibility & Focus Rings --- */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Screen reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
