/* ================================================================
   KERALAM CLEAN COOKING TOOL — DESIGN SYSTEM
   Mobile-first, consolidated, no duplicate rules.
   Breakpoints: mobile-first base → tablet 768px → desktop 992px
   ================================================================ */

/* ── 1. DESIGN TOKENS ─────────────────────────────────────────── */
:root {
  /* Brand */
  --primary-green:  #228B22;
  --dark-green:     #1b5e20;
  --light-green:    #4CAF50;
  --bg-green:       #DEFBDD;
  --bg-mint:        #BEF8BA;

  /* Accents */
  --accent-yellow:  #F2C851;
  --accent-orange:  #FF6700;
  --accent-brown:   #A0522D;

  /* Neutrals */
  --text-grey:      #323232;
  --text-muted:     #6c757d;
  --bg-cream:       #FFF1D7;
  --bg-yellow-light:#FFE7B6;
  --card-bg:        #FFFFFF;

  /* Status */
  --success-light:  #d4edda;
  --warning-light:  #fff3cd;
  --danger-light:   #f8d7da;
  --info-light:     #d1ecf1;

  /* Spacing (8-point grid) */
  --sp-1: 0.25rem;   /* 4px  */
  --sp-2: 0.5rem;    /* 8px  */
  --sp-3: 0.75rem;   /* 12px */
  --sp-4: 1rem;      /* 16px */
  --sp-5: 1.25rem;   /* 20px */
  --sp-6: 1.5rem;    /* 24px */
  --sp-8: 2rem;      /* 32px */
  --sp-10: 2.5rem;   /* 40px */
  --sp-12: 3rem;     /* 48px */

  /* Legacy aliases (keep for template compatibility) */
  --spacing-xs:  var(--sp-1);
  --spacing-sm:  var(--sp-2);
  --spacing-md:  var(--sp-4);
  --spacing-lg:  var(--sp-6);
  --spacing-xl:  var(--sp-8);
  --spacing-xxl: var(--sp-12);

  /* Radii */
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   20px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 2px 10px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 20px rgba(34,139,34,0.10);
  --shadow-lg: 0 8px 30px rgba(34,139,34,0.15);
  --shadow-xl: 0 0.5rem 1.5rem rgba(14,164,75,0.20);

  /* Touch target minimum */
  --touch-min: 44px;
}


/* ── 2. RESET & BASE ──────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Prevent the side gap: clip overflow at the root level so no
     child element (Bootstrap rows, absolutely positioned elements,
     wide tables) can create a horizontal scrollbar/whitespace gap */
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, var(--bg-green) 0%, var(--bg-mint) 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  width: 100%;
  color: var(--text-grey);
  line-height: 1.6;
  /* Safe area insets for notched devices */
  padding-left:  env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

main {
  flex: 1;
  width: 100%;
  padding-top: var(--sp-4);
  padding-bottom: var(--sp-6);
}

img,
svg {
  max-width: 100%;
  height: auto;
  /* Use inline-block (not block) so parent text-align:center centres images.
     Block images ignore text-align and sit left regardless of parent. */
  display: inline-block;
  vertical-align: middle;
}

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

a:hover { color: var(--dark-green); }


/* ── 3. TYPOGRAPHY ────────────────────────────────────────────── */
/*
  Mobile-first scale — grows on larger screens.
  FIX: The original had h1=20px on desktop, 2rem on mobile (reversed!).
  Correct: mobile base is smaller, desktop is larger.
*/
h1, h2, h3, h4, h5, h6 {
  color: var(--primary-green);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: var(--sp-4);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem;  }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem;  }
h5 { font-size: 1rem;    }
h6 { font-size: 0.9rem;  }

@media (min-width: 768px) {
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.875rem; }
  h3 { font-size: 1.5rem;  }
  h4 { font-size: 1.25rem; }
  h5 { font-size: 1.1rem;  }
  h6 { font-size: 1rem;    }
}

@media (min-width: 992px) {
  h1 { font-size: 2.75rem; }
  h2 { font-size: 2.25rem; }
  h3 { font-size: 1.75rem; }
  h4 { font-size: 1.35rem; }
}

p {
  margin-bottom: var(--sp-4);
  line-height: 1.6;
}

p:last-child { margin-bottom: 0; }

.text-primary-green { color: var(--primary-green) !important; }
.text-muted         { color: var(--text-muted) !important; }
.fw-bold            { font-weight: 700 !important; }
.fw-semibold        { font-weight: 600 !important; }
.font-medium        { font-weight: 500; }
.font-semibold      { font-weight: 600; }
.font-bold          { font-weight: 700; }
.small              { font-size: 0.875rem !important; }
.text-gray-900      { color: #111827; }
.text-gray-500      { color: #6b7280; }
.bg-gray-50         { background-color: #f9fafb; }

/* Malayalam */
.malayalam-text {
  font-family: 'Noto Sans Malayalam', 'Poppins', sans-serif;
  line-height: 1.7;
}


/* ── 4. LAYOUT UTILITIES ──────────────────────────────────────── */
.container {
  width: 100%;
  padding-left: var(--sp-4);
  padding-right: var(--sp-4);
}

.w-100  { width: 100% !important; }
.mw-150 { max-width: 150px !important; }
.d-none  { display: none !important; }
.d-block { display: block !important; }
.d-flex  { display: flex !important; }

/* Margin helpers */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: var(--sp-1) !important; }
.mb-2 { margin-bottom: var(--sp-2) !important; }
.mb-3 { margin-bottom: var(--sp-4) !important; }
.mb-4 { margin-bottom: var(--sp-6) !important; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: var(--sp-1) !important; }
.mt-2 { margin-top: var(--sp-2) !important; }
.mt-3 { margin-top: var(--sp-4) !important; }
.mt-4 { margin-top: var(--sp-6) !important; }

/* Padding helpers */
.p-3  { padding: var(--sp-4) !important; }
.p-4  { padding: var(--sp-6) !important; }


/* ── 5. HEADER ────────────────────────────────────────────────── */
.header-container {
  width: 100%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 1000;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-3) var(--sp-4);
  max-width: 1400px;
  margin: 0 auto;
}

.logo-left img {
  height: 50px;
  width: auto;
  transition: opacity 0.2s;
}

.logo-left img:hover { opacity: 0.85; }

.logo-right-group {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.emc-logo {
  height: 40px;
  width: auto;
}

@media (min-width: 768px) {
  .top-bar { padding: var(--sp-4) 5%; }
  .logo-left img { height: 70px; }
  .emc-logo { height: 55px; }
}

/* Green nav strip */
.green-strip {
  background: linear-gradient(90deg, var(--primary-green), var(--dark-green));
  color: #fff;
  padding: 0.55rem var(--sp-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.green-strip img { height: 26px; }

@media (min-width: 768px) {
  .green-strip {
    padding: 0.6rem 5%;
  }
  .green-strip img { height: 30px; }
}

/* Language button */
.lang-btn {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  transition: background 0.2s;
  min-height: var(--touch-min);
  cursor: pointer;
}

.lang-btn:hover { background: rgba(255,255,255,0.32); }

.lang-text {
  /* Hidden on very small screens, shown at 360px+ */
  display: none;
}

@media (min-width: 360px) {
  .lang-text { display: inline; }
}

.green-strip .dropdown-menu {
  border: none;
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: var(--sp-2);
}

.green-strip .dropdown-item {
  padding: var(--sp-2) var(--sp-4);
  font-size: 0.9rem;
  transition: background 0.15s;
  min-height: var(--touch-min);
  display: flex;
  align-items: center;
}

.green-strip .dropdown-item:hover {
  background-color: var(--bg-green);
  color: var(--primary-green);
}

/* Show/hide utilities for responsive nav */
@media (min-width: 768px) {
  .show-on-desktop { display: block !important; }
  .show-on-mobile  { display: none  !important; }
}

@media (max-width: 767.98px) {
  .show-on-desktop { display: none  !important; }
  .show-on-mobile  { display: block !important; }
}


/* ── 6. CARDS ─────────────────────────────────────────────────── */
.card {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(10px);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  margin-bottom: var(--sp-4);
  overflow: hidden; /* keeps child border-radii clean */
}

/* Disable lift on touch devices to avoid sticky-hover issues */
@media (hover: hover) {
  .card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
  }
}

.card-header {
  background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
  color: #fff !important;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  border: none;
  padding: var(--sp-6);
}

.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6 { color: #fff !important; margin-bottom: 0; }

.card-header p { color: rgba(255,255,255,0.9) !important; margin-bottom: 0; }

.card-body {
  padding: var(--sp-4);
}

@media (min-width: 768px) {
  .card-body { padding: var(--sp-6); }
  .card { margin-bottom: var(--sp-6); }
}

.card-title {
  color: var(--primary-green);
  font-weight: 600;
  margin-bottom: var(--sp-4);
}

.shadow-green    { box-shadow: var(--shadow-md) !important; }
.shadow-green-lg { box-shadow: var(--shadow-xl) !important; }


/* ── 7. BUTTONS ───────────────────────────────────────────────── */
.btn {
  border-radius: var(--radius-md);
  padding: 0.7rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.25s ease;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--touch-min);
  cursor: pointer;
  line-height: 1.3;
}

/* Primary / Success */
.btn-success,
.btn-primary-green {
  background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
  color: #fff;
  border: none;
}

.btn-success:hover,
.btn-primary-green:hover {
  background: linear-gradient(135deg, var(--dark-green), var(--primary-green));
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(34,139,34,0.30);
}

/* Outline */
.btn-outline-success {
  border: 2px solid var(--primary-green);
  color: var(--primary-green);
  background: transparent;
}

.btn-outline-success:hover {
  background: var(--primary-green);
  color: #fff;
  border-color: var(--primary-green);
  transform: translateY(-1px);
}

/* Navigation — Next */
.btn-nav-next {
  background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
  border: none;
  border-radius: var(--radius-pill);
  padding: 0.75rem 1.75rem;
  font-weight: 600;
  color: #fff;
  min-height: var(--touch-min);
}

.btn-nav-next:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(34,139,34,0.30);
  background: linear-gradient(135deg, var(--dark-green), var(--primary-green));
  color: #fff;
}

/* Navigation — Back */
.btn-nav-back {
  border: 2px solid var(--accent-yellow);
  color: var(--text-grey);
  background: transparent;
  border-radius: var(--radius-pill);
  padding: 0.75rem 1.75rem;
  font-weight: 600;
  min-height: var(--touch-min);
}

.btn-nav-back:hover {
  background: var(--accent-yellow);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(242,200,81,0.30);
}

/* Sizes */
.btn-lg {
  padding: 0.9rem 2rem;
  font-size: 1.05rem;
}

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  min-height: 36px;
}

/* Full-width on mobile for nav buttons */
@media (max-width: 479px) {
  .btn-nav-next,
  .btn-nav-back {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
  }
}

/* Proceed button (analysis selection cards) */
.proceed-btn-custom {
  border: 2.5px solid var(--primary-green) !important;
  transition: all 0.3s ease;
  font-weight: 600;
  min-height: var(--touch-min);
}

.proceed-btn-custom:hover {
  background: linear-gradient(135deg, var(--primary-green), var(--dark-green)) !important;
  color: #fff !important;
  border-color: var(--primary-green) !important;
  transform: translateY(-2px);
}


/* ── 8. FORMS ─────────────────────────────────────────────────── */
.form-control,
.form-select {
  border: 2px solid #e9ecef;
  border-radius: var(--radius-md);
  padding: 0.7rem 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: rgba(255,255,255,0.92);
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  color: var(--text-grey);
  width: 100%;
  min-height: var(--touch-min);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-green);
  box-shadow: 0 0 0 0.2rem rgba(34,139,34,0.15);
  background: #fff;
  outline: none;
}

.form-label {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--primary-green);
  margin-bottom: var(--sp-2);
  display: block;
}

.form-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--sp-1);
  display: block;
}

/* Input groups */
.input-group { margin-bottom: var(--sp-4); }

.input-group-text {
  background: var(--bg-green);
  border: 2px solid #e9ecef;
  border-right: none;
  color: var(--primary-green);
  font-weight: 600;
}

/* Checkboxes & Radios */
.form-check-input {
  width: 1.15em;
  height: 1.15em;
  margin-top: 0.1em;
  border: 2.5px solid var(--primary-green);
  background-color: #fff;
  transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.form-check-input[type="radio"] { border-radius: 50%; }

.form-check-input:checked {
  background-color: var(--primary-green);
  border-color: var(--primary-green);
  box-shadow: 0 0 0 0.2rem rgba(34,139,34,0.20);
}

.form-check-input:focus {
  border-color: var(--primary-green);
  box-shadow: 0 0 0 0.2rem rgba(34,139,34,0.20);
  outline: none;
}

.form-check-label {
  font-weight: 400;
  font-size: 0.93rem;
  color: var(--text-grey);
  margin-left: var(--sp-2);
  cursor: pointer;
  line-height: 1.5;
}

/* Bootstrap validation overrides */
.needs-validation .form-control:invalid,
.needs-validation .form-select:invalid { border-color: #dc3545; }

.needs-validation .form-control:valid,
.needs-validation .form-select:valid   { border-color: var(--primary-green); }


/* ── 9. ALERTS ────────────────────────────────────────────────── */
.alert {
  border: none;
  border-radius: var(--radius-md);
  border-left: 4px solid;
  padding: var(--sp-4) var(--sp-6);
  margin-bottom: var(--sp-6);
}

.alert-info {
  background: var(--bg-yellow-light);
  border-left-color: var(--accent-yellow);
  color: #627578;
}

.alert-warning {
  background: linear-gradient(135deg, #fff3cd, #ffeaa7);
  border-left-color: #ffc107;
  color: #856404;
}

.alert-success {
  background: linear-gradient(135deg, var(--success-light), #c3e6cb);
  border-left-color: #28a745;
  color: #155724;
}

.alert-danger {
  background: linear-gradient(135deg, var(--danger-light), #f5c6cb);
  border-left-color: #dc3545;
  color: #721c24;
}

.alert-light {
  background: #f8f9fa;
  border-left-color: var(--primary-green);
  color: var(--text-grey);
}


/* ── 10. BADGES ───────────────────────────────────────────────── */
.badge {
  padding: 0.35em 0.65em;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 0.375rem;
  display: inline-flex;
  align-items: center;
}


/* ── 11. TABLES ───────────────────────────────────────────────── */
.table {
  margin-bottom: var(--sp-6);
  width: 100%;
}

.table-responsive {
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-6);
  -webkit-overflow-scrolling: touch;
  overflow-x: auto;
}

.comparison-table {
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  min-width: 600px; /* horizontal scroll on mobile */
}

.comparison-table th {
  background: var(--primary-green);
  color: #fff;
  font-weight: 600;
  border: none;
  padding: 0.85rem var(--sp-4);
  white-space: nowrap;
  font-size: 0.9rem;
}

.comparison-table td {
  padding: 0.85rem var(--sp-4);
  border-color: #f8f9fa;
  vertical-align: middle;
  font-size: 0.9rem;
}

.comparison-table tbody tr:hover {
  background-color: rgba(34,139,34,0.04);
}

.table-sm td,
.table-sm th { padding: var(--sp-2); }

/* Sortable headers */
.sortable {
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.sortable i {
  font-size: 0.8em;
  opacity: 0.6;
  margin-left: 0.15rem;
}

@media (max-width: 767px) {
  .comparison-table th,
  .comparison-table td {
    padding: 0.65rem var(--sp-2);
    font-size: 0.82rem;
  }

  .comparison-table .badge {
    font-size: 0.72rem;
    padding: 0.3em 0.45em;
  }
}


/* ── 12. METRIC CARDS ─────────────────────────────────────────── */
.metric-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border-left: 4px solid var(--primary-green);
}

@media (hover: hover) {
  .metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 25px rgba(0,0,0,0.10);
  }
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-green);
  display: block;
  line-height: 1.2;
}

@media (min-width: 768px) {
  .metric-value { font-size: 2rem; }
}

.metric-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: var(--sp-2);
  font-weight: 500;
}

.metric-change { font-size: 0.8rem; margin-top: var(--sp-1); }
.metric-change.positive { color: #28a745; }
.metric-change.negative { color: #dc3545; }

/* Health risk variants */
.health-risk-low {
  background: linear-gradient(135deg, var(--success-light), #c3e6cb);
  color: #155724;
  border-left-color: #28a745;
}

.health-risk-moderate {
  background: linear-gradient(135deg, var(--warning-light), #ffeaa7);
  color: #856404;
  border-left-color: #ffc107;
}

.health-risk-high {
  background: linear-gradient(135deg, var(--danger-light), #f5c6cb);
  color: #721c24;
  border-left-color: #dc3545;
}

.health-risk-very-high {
  background: linear-gradient(135deg, #721c24, #a71e2a);
  color: #fff;
  border-left-color: #990000;
}


/* ── 13. CHARTS ───────────────────────────────────────────────── */
.chart-container {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--sp-8);
  border: 1px solid rgba(34,139,34,0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}

.chart-container::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-green), var(--dark-green));
}

@media (hover: hover) {
  .chart-container:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
  }
}

.chart-title {
  color: var(--primary-green);
  font-weight: 700;
  margin-bottom: var(--sp-6);
  text-align: center;
  font-size: 1rem;
  letter-spacing: 0.3px;
}

.chart-container canvas {
  max-height: 300px !important;
  border-radius: var(--radius-sm);
}

@media (min-width: 768px) {
  .chart-container {
    padding: var(--sp-8);
  }
  .chart-container canvas {
    max-height: 400px !important;
  }
  .chart-title { font-size: 1.1rem; }
}

.chart-footnote {
  margin-top: var(--sp-4);
  font-size: 0.82rem;
  text-align: center;
  color: var(--text-muted);
}

/* Chart loading state */
.chart-container.loading::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 40px; height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid rgba(34,139,34,0.25);
  border-radius: 50%;
  border-top-color: var(--primary-green);
  animation: spin 0.85s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.chart-error {
  background: rgba(220,53,69,0.04);
  border: 2px dashed rgba(220,53,69,0.2);
  border-radius: var(--radius-sm);
  padding: var(--sp-6);
  text-align: center;
  margin: var(--sp-4) 0;
}

.error-container-dashed {
  text-align: center;
  padding: var(--sp-6);
  color: #dc3545;
  border: 1px dashed #dc3545;
  border-radius: var(--radius-sm);
}


/* ── 14. PROGRESS STEPS ───────────────────────────────────────── */
.progress-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4) var(--sp-2);
  margin-bottom: var(--sp-6);
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: 1;
  max-width: 150px;
}

.progress-step .step-number {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #e9ecef;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
  border: 2px solid #e9ecef;
  transition: all 0.3s ease;
  z-index: 2;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .progress-step .step-number {
    width: 36px; height: 36px;
    font-size: 0.9rem;
    border-width: 3px;
  }
}

.progress-step .step-label {
  margin-top: var(--sp-2);
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  font-weight: 500;
  line-height: 1.2;
}

@media (max-width: 479px) {
  .progress-step .step-label { display: none; }
}

@media (min-width: 768px) {
  .progress-step .step-label { font-size: 0.75rem; }
}

.progress-step.completed .step-number {
  background: var(--primary-green);
  color: #fff;
  border-color: var(--primary-green);
}

.progress-step.completed .step-label {
  color: var(--primary-green);
  font-weight: 600;
}

.progress-step.active .step-number {
  background: var(--primary-green);
  color: #fff;
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(34,139,34,0.20);
  transform: scale(1.1);
}

.progress-step.active .step-label {
  color: var(--primary-green);
  font-weight: 700;
}

.progress-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 15px;
  left: calc(50% + 15px);
  width: calc(100% - 30px);
  height: 2px;
  background: #e9ecef;
  z-index: 1;
}

@media (min-width: 768px) {
  .progress-step:not(:last-child)::after {
    top: 18px;
    left: calc(50% + 18px);
    width: calc(100% - 36px);
    height: 3px;
  }
}

.progress-step.completed:not(:last-child)::after {
  background: var(--primary-green);
}


/* ── 15. HERO SECTION (INDEX PAGE) ───────────────────────────── */
.hero-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
  animation: fadeInUp 0.55s ease-out;
}

.hero-image-wrapper { order: 1; }
.hero-content       { order: 2; }

.hero-image {
  width: 100%;
  height: 200px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  display: block; /* override img reset for this one */
}

.hero-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--primary-green);
  margin-bottom: 0.4rem;
  line-height: 1.15;
}

.hero-subtitle {
  font-size: 0.95rem;
  color: var(--text-grey);
  line-height: 1.6;
  margin-bottom: var(--sp-4);
}

/* CTA Buttons */
.cta-primary {
  background: var(--light-green);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 0.9rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 4px 12px rgba(112,193,112,0.30);
  text-decoration: none;
  min-height: var(--touch-min);
}

.cta-primary:hover {
  background: #5da55d;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(112,193,112,0.40);
}

.cta-secondary {
  background: #fff;
  color: var(--text-grey);
  border: 2px solid var(--accent-yellow);
  border-radius: var(--radius-pill);
  padding: 0.8rem 2rem;
  font-size: 0.95rem;
  font-weight: 500;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  cursor: pointer;
  transition: all 0.25s;
  margin-top: var(--sp-4);
  text-decoration: none;
  min-height: var(--touch-min);
}

.cta-secondary:hover {
  background: #fffdf5;
  color: var(--text-grey);
  transform: translateY(-1px);
}

/* Stats bar */
.stats-container {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 0.5rem 0.75rem;
  margin: var(--sp-4) 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: var(--shadow-md);
}

.stat-item {
  text-align: center;
  flex: 1;
  padding: var(--sp-2) 0;
}

.stat-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-yellow);
  display: block;
}

.stat-label {
  font-size: 0.68rem;
  color: var(--text-grey);
  margin-top: 0.25rem;
  line-height: 1.2;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: #e3e3e3;
  margin: 0 var(--sp-2);
  flex-shrink: 0;
}

/* Desktop hero layout */
@media (min-width: 992px) {
  .hero-section {
    flex-direction: row-reverse;
    align-items: center;
    gap: 5rem;
    padding: 4rem 5%;
    min-height: calc(100vh - 200px);
  }

  .hero-content {
    flex: 1;
    max-width: 50%;
    order: 1;
  }

  .hero-image-wrapper {
    flex: 1;
    max-width: 50%;
    order: 2;
  }

  .hero-image {
    height: 500px;
    border-radius: var(--radius-xl);
  }

  .hero-title    { font-size: 3.25rem; margin-bottom: var(--sp-6); }
  .hero-subtitle { font-size: 1.2rem; margin-bottom: var(--sp-8); }

  .cta-primary   { width: auto; padding: 1rem 3rem; font-size: 1.1rem; }
  .cta-secondary { width: auto; padding: 0.9rem 2.5rem; font-size: 1rem; }

  .stats-container {
    padding: var(--sp-8);
    margin: var(--sp-8) 0;
    gap: var(--sp-8);
  }

  .stat-value { font-size: 2.5rem; }
  .stat-label { font-size: 0.95rem; }
  .stat-divider { height: 60px; }
}

@media (min-width: 768px) and (max-width: 991px) {
  .hero-title    { font-size: 2.25rem; }
  .hero-subtitle { font-size: 1.05rem; }
  .hero-image    { height: 340px; }
  .stat-value    { font-size: 1.5rem; }
  .stat-label    { font-size: 0.8rem; }
}


/* ── 16. ANALYSIS CONTAINER ───────────────────────────────────── */
.analysis-container-custom {
  background-color: #f4fff4;
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  /* Use max-width + auto margins instead of fixed pixel margins
     so the container never overflows the viewport on any screen */
  margin: var(--sp-4) auto;
  width: 100%;
  /* Clip any Bootstrap row negative gutters that could cause overflow */
  overflow-x: hidden;
}

@media (min-width: 992px) {
  .analysis-container-custom {
    padding: var(--sp-6);
  }
}

/* Cards inside this container get a clean white background */
.analysis-container-custom .card-body {
  background-color: #fff;
  border-radius: var(--radius-md);
}


/* ── 17. INSTITUTION / SELECTION BUTTONS ──────────────────────── */
.institution-buttons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}

.institution-btn-wrapper {
  position: relative;
}

.institution-btn-wrapper input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}

.institution-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5) var(--sp-4);
  background: #fff;
  border: 2px solid #e9ecef;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
  color: var(--text-grey);
  min-height: var(--touch-min);
  height: 100%;
}

.institution-btn i {
  font-size: 1.8rem;
  margin-bottom: 0.6rem;
  color: var(--primary-green);
  transition: transform 0.25s ease;
}

.institution-btn span {
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.3;
}

.institution-btn:hover {
  border-color: var(--light-green);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

.institution-btn-wrapper input[type="radio"]:checked + .institution-btn {
  border-color: var(--primary-green);
  background-color: var(--bg-green);
  color: var(--primary-green);
  box-shadow: 0 4px 15px rgba(76,175,80,0.20);
  transform: translateY(-3px);
}

.institution-btn-wrapper input[type="radio"]:checked + .institution-btn i {
  transform: scale(1.1);
}


/* ── 18. METHOD & SCENARIO CARDS ──────────────────────────────── */
.method-card,
.scenario-card {
  cursor: pointer;
  transition: all 0.25s ease;
  border: 2px solid #e9ecef;
}

.method-card:hover,
.scenario-card:hover {
  border-color: var(--primary-green);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.method-card.selected,
.scenario-card.selected {
  border-color: var(--primary-green);
  background-color: rgba(76,175,80,0.05);
}

/* Option card (analysis-selection page) */
.option-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: var(--radius-md);
}

@media (hover: hover) {
  .option-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 1.25rem 2rem rgba(0,0,0,0.12) !important;
  }
}


/* ── 19. SCHEME CARDS (FEEDBACK) ──────────────────────────────── */
.scheme-card {
  border-left: 4px solid var(--primary-green);
  transition: all 0.25s ease;
}

@media (hover: hover) {
  .scheme-card:hover {
    box-shadow: 0 0.5rem 1rem rgba(14,164,75,0.18);
    transform: translateX(4px);
  }
}

.form-check-input:checked ~ .form-check-label .card-body {
  background-color: #f0f9f4;
}


/* ── 20. RECOMMENDATION CARDS ─────────────────────────────────── */
.recommendation-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 2px solid transparent;
  transition: all 0.3s ease;
  overflow: hidden;
}

.recommendation-card.top-choice {
  border-color: var(--primary-green);
  box-shadow: 0 6px 30px rgba(34,139,34,0.20);
}


/* ── 21. DISH SELECTION ───────────────────────────────────────── */
.dish-selection {
  max-height: 300px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--sp-2);
  border-radius: var(--radius-sm);
}

.dish-selection .form-check {
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  margin-left: 12px;
  transition: background-color 0.15s;
  min-height: var(--touch-min);
  display: flex;
  align-items: center;
}

.dish-selection .form-check:hover {
  background-color: rgba(76,175,80,0.05);
}

/* Fuel inline selector helper */
.fuel-inline { min-height: 24px; }

/* Fuel detail panels */
.fuel-details {
  border-left: 3px solid var(--primary-green);
  padding-left: var(--sp-4);
  margin-top: var(--sp-4);
  margin-bottom: var(--sp-6);
}

/* Method toggle content */
.method-content { animation: fadeInUp 0.3s ease-out; }


/* ── 22. ICONS ────────────────────────────────────────────────── */
.icon-small  { font-size: 1rem;   color: var(--primary-green); }
.icon-medium { font-size: 1.5rem; color: var(--primary-green); }
.icon-large  { font-size: 2rem;   color: var(--primary-green); }
.icon-xl     { font-size: 3rem;   color: var(--primary-green); }
.icon-giant  { font-size: 5rem;   color: var(--primary-green); }

/* icon-xxl serves both Bootstrap Icon fonts and <img> tags.
   display:block + margin:auto centres it when inside text-center parents.
   The parent's text-align:center centres inline icons (Bootstrap Icons).   */
.icon-xxl {
  font-size: 4rem;
  color: var(--primary-green);
  width: 4rem;
  height: 4rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 767px) {
  .icon-xxl  { font-size: 3rem;  width: 3rem;  height: 3rem; }
  .icon-giant{ font-size: 3.5rem; }
}


/* ── 23. FOOTER ───────────────────────────────────────────────── */
.footer-area {
  background-color: #fff;
  border-top: 1px solid #e9ecef;
  padding: var(--sp-8) 0 var(--sp-6);
  margin-top: auto;
  box-shadow: 0 -4px 10px rgba(0,0,0,0.02);
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--sp-4);
}

@media (min-width: 768px) {
  .footer-content { padding: 0 5%; }
}

.footer-top {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.footer-brand-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-6);
  width: 100%;
}

.footer-brand-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-2);
  min-width: 0;
}

.footer-brand-block-end {
  align-items: flex-end;
  text-align: right;
}

.footer-logo {
  display: flex;
  align-items: center;
}

.footer-logo-end {
  justify-content: flex-end;
}

.footer-logo img {
  height: 36px;
  width: auto;
  transition: transform 0.25s;
}

.footer-logo img:hover { transform: scale(1.05); }

@media (max-width: 767px) {
  .footer-top {
    gap: var(--sp-4);
  }

  .footer-brand-row {
    justify-content: flex-start;
    gap: var(--sp-3);
  }

  .footer-brand-block,
  .footer-brand-block-end {
    align-items: flex-start;
    text-align: left;
  }

  .footer-logo-end {
    justify-content: flex-start;
  }

  .footer-logo img { height: 28px; }
}

.footer-location {
  font-size: 0.92rem;
  color: var(--text-grey);
  font-weight: 500;
  line-height: 1.35;
}

.footer-contact-title {
  font-weight: 700;
  margin-bottom: var(--sp-4);
  color: var(--primary-green);
  font-size: 1.05rem;
}

.footer-contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-contact-links a {
  color: var(--text-grey);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.92rem;
  transition: all 0.2s;
  min-height: var(--touch-min);
}

.footer-contact-links a i {
  color: var(--primary-green);
  font-size: 1.05rem;
  flex-shrink: 0;
}

.footer-contact-links a:hover {
  color: var(--primary-green);
  transform: translateX(3px);
}

.footer-copyright {
  text-align: center;
  padding-top: var(--sp-6);
  border-top: 1px solid #f0f0f0;
  font-size: 0.82rem;
  color: #888;
  line-height: 1.6;
}


/* ── 24. HOVER HELPER (contact page links etc.) ───────────────── */
.hover-shadow {
  transition: all 0.22s ease;
}

@media (hover: hover) {
  .hover-shadow:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.75rem 1.5rem rgba(0,0,0,0.10);
    border-color: var(--primary-green) !important;
    background-color: var(--bg-green);
  }
}


/* ── 25. ERROR PAGE ───────────────────────────────────────────── */
.error-icon i {
  font-size: 5rem;
}

@media (max-width: 767px) {
  .error-icon i { font-size: 3.5rem; }
  h1.display-3  { font-size: 3rem; }
}

.quick-link-card {
  padding: var(--sp-6);
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-sm);
  transition: all 0.25s ease;
  background: #fff;
  text-align: center;
}

.quick-link-card:hover {
  border-color: var(--primary-green);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.quick-link-card i {
  font-size: 2rem;
  color: var(--primary-green);
  display: block;
  margin-bottom: var(--sp-2);
}

.quick-link-card p {
  color: var(--dark-green);
  font-weight: 500;
  margin-bottom: 0;
}


/* ── 26. ADMIN / HOUSEHOLD CARDS ──────────────────────────────── */
.household-card {
  border: 1px solid #ddd;
  border-radius: var(--radius-sm);
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
  background-color: #f9f9f9;
}

.household-id {
  font-family: monospace;
  font-size: 0.88em;
  color: #666;
}


/* ── 27. LOADING STATES ───────────────────────────────────────── */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.spinner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.82);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}


/* ── 28. ANIMATIONS ───────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0);    }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0);    }
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.fade-in-up    { animation: fadeInUp    0.55s ease-out both; }
.slide-in-right{ animation: slideInRight 0.55s ease-out both; }
.slide-in      { animation: slideInUp   0.5s ease-out both; }

/* Stagger delays */
.delay-1 { animation-delay: 0.10s; }
.delay-2 { animation-delay: 0.20s; }
.delay-3 { animation-delay: 0.30s; }
.delay-4 { animation-delay: 0.40s; }


/* ── 29. FONT-SIZE UTILITIES ──────────────────────────────────── */
.fs-075 { font-size: 0.75rem !important; }
.fs-09  { font-size: 0.9rem  !important; }
.fs-095 { font-size: 0.95rem !important; }
.fs-1-1 { font-size: 1.1rem  !important; }


/* ── 30. COLOR UTILITIES ──────────────────────────────────────── */
.bg-primary-green  { background-color: var(--primary-green) !important; }
.bg-soft-green     { background-color: rgba(34,139,34,0.05) !important; }
.border-primary-green { border-color: var(--primary-green) !important; }
.bg-light          { background-color: #f8f9fa !important; }


/* ── 31. ACCESSIBILITY ────────────────────────────────────────── */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus-visible ring for keyboard navigation */
:focus-visible {
  outline: 3px solid var(--primary-green);
  outline-offset: 2px;
}

/* Ensure interactive elements have adequate tap target on mobile */
@media (max-width: 767px) {
  .form-check {
    min-height: var(--touch-min);
    display: flex;
    align-items: center;
    padding-top: var(--sp-2);
    padding-bottom: var(--sp-2);
  }
}
