/* =====================================================================
   My Heat Risk Profile - custom warm theme on top of Bootstrap 5.3
   Larger fluid type, big hit targets and clear focus rings for an older
   audience. Layout reflows on any phone / tablet / desktop width.
   Edit colours here; risk-gauge colours live in the CSVs.
   ===================================================================== */

:root {
  --hrp-primary:   #396481;
  --hrp-primary-d: #2f5269;
  --hrp-focus:     #40accc;
  --hrp-surface:   #fffdfa;
  --hrp-border:    #ece2d4;
  --hrp-ink:       #2b2622;
  --hrp-ink-soft:  #5c554c;
  --hrp-muted:     #8a8175;
  --hrp-radio-bd: #b8ab97; /* darker, still on-palette, meets non-text contrast */
  --bs-accordion-border-width: 2px !important;
  --bs-body-font-size: 19px !important;
  --bs-tooltip-font-size: 18px !important;
}

body { -webkit-font-smoothing: antialiased; line-height: 1.5; }

/* ---- Header --------------------------------------------------------*/
.hrp-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px clamp(18px, 4vw, 22px);
  background: var(--hrp-surface);
  border-bottom: 1px solid var(--hrp-border);
  position: sticky; top: 0; z-index: 5;
}
.hrp-brand { font-weight: 800; font-size: clamp(18px, 4.5vw, 20px); letter-spacing: -.01em; color: var(--hrp-primary); }

/* ---- Layout --------------------------------------------------------*/
.hrp-shell { background: var(--body-bg, #f7f6f3); min-height: calc(100vh - 60px); }
.hrp-page  { max-width: 680px; margin: 0 auto; padding: clamp(20px, 5vw, 32px) clamp(18px, 5vw, 22px) 72px; }

.hrp-h1 { font-size: clamp(28px, 8vw, 40px); font-weight: 800; letter-spacing: -.02em; color: var(--hrp-ink); margin: 0 0 14px; }
.hrp-h2 { font-size: clamp(24px, 6.5vw, 30px); font-weight: 800; letter-spacing: -.01em; color: var(--hrp-ink); margin: 0 0 8px; }
.hrp-h3 { font-size: clamp(21px, 5.5vw, 24px); font-weight: 800; color: var(--hrp-ink); margin: 0 0 6px; }
.hrp-lead    { font-size: clamp(20px, 4.8vw, 22px); color: var(--hrp-ink-soft); max-width: 540px; margin: 0 auto; text-wrap: pretty; }
.hrp-lead-sm { font-size: clamp(18px, 4.4vw, 20px); color: var(--hrp-ink-soft); margin: 0 0 28px; text-wrap: pretty; }
.hrp-muted   { font-size: clamp(18px, 4vw, 20px); color: var(--hrp-muted); margin: 0 0 8px; }
.hrp-fine    { font-size: clamp(16px, 3.8vw, 18px); color: var(--hrp-muted); margin-top: 14px; }
.hrp-hero-mark { margin-bottom: 18px; }

/* ---- Cards ---------------------------------------------------------*/
.hrp-card {
  background: var(--hrp-surface);
  border: 1px solid var(--hrp-border) !important;
  border-radius: 16px !important;
}
.hrp-card .card-body { padding: clamp(18px, 5vw, 26px); }
.hrp-note { margin: clamp(24px, 6vw, 36px) 0 32px; text-align: left; }
.hrp-note-title { display: flex; align-items: center; gap: 10px; font-size: clamp(18px, 4.6vw, 20px); font-weight: 800; color: var(--hrp-primary); margin: 0 0 10px; }
.hrp-note-i {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  background: #e8f1f5; color: var(--hrp-primary); font-weight: 800; font-size: 16px;
}

/* ---- Progress steps -----------------------------------------------*/
.hrp-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: clamp(18px, 3.6vw, 19px); font-weight: 700; color: var(--hrp-muted); margin-bottom: 22px; }
.hrp-steps .done    { color: #258958; }
.hrp-steps .current { color: var(--hrp-primary); background: #e8f1f5; padding: 3px 10px; border-radius: 20px; }

/* ---- Category headings --------------------------------------------*/
.hrp-cat-head  { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.hrp-cat-num   { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: none; border-radius: 9px; background: var(--hrp-primary); color: #fff; font-weight: 800; font-size: 16px; }
.hrp-cat-title { font-size: clamp(18px, 5vw, 20px); font-weight: 800; color: var(--hrp-ink); margin: 0; }
.hrp-fieldset  { border: 0; padding: 0; margin: 0 0 22px; }
.hrp-fieldset:last-child { margin-bottom: 0; }
.hrp-legend    { font-size: clamp(18px, 4.8vw, 20px); font-weight: 700; color: var(--hrp-ink); margin-bottom: 12px; float: none; width: auto; }
.hrp-legend [data-bs-toggle="tooltip"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  margin-left: 4px;
  color: var(--hrp-primary);
  cursor: pointer;
}

/* Make default tooltip text bigger */

.tooltip-inner {
 font-size: 18px !important;
}

#go_result:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* ---- Options (native Bootstrap 5.3 .btn-check pattern) -------------
   Markup:  .hrp-optgrid > ( input.btn-check + label.btn.btn-hrp-opt ) x N
   This is how Bootstrap 5.3 shows a "selected" button: the radio input
   carries .btn-check (Bootstrap hides it) and, when :checked, styles its
   ADJACENT label through the "+" selector. No .active class, no JavaScript.
   The grid flex-wraps so options reflow from 1 to 3 per row by width. */
.hrp-optgrid { display: flex; flex-wrap: wrap; gap: 12px; width: 100%; }

.hrp-optgrid .btn-hrp-opt {
  flex: 1 1 160px;            /* reflows: 1 col on narrow phones, 2-3 wider */
  display: flex; align-items: center; justify-content: flex-start;
  min-height: 58px; margin: 0; text-align: left; white-space: normal;
  padding: 14px 18px;
  border: 2px solid var(--hrp-radio-bd); border-radius: 12px;
  background: #fff; color: var(--hrp-ink);
  font-size: clamp(18px, 4.4vw, 21px); font-weight: 500; line-height: 1.3;
  box-shadow: none; cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}
.hrp-optgrid .btn-hrp-opt:hover { border-color: var(--hrp-primary); background: #f4f8fa; color: var(--hrp-ink); }

/* selected state - Bootstrap's native checked-input + adjacent-label rule */
.btn-check:checked + .btn-hrp-opt {
  border-color: var(--hrp-primary);
  background: #eef4f7;
  color: var(--hrp-ink);
  font-weight: 700;
  box-shadow: none;
}
/* keyboard focus ring (focus lands on the hidden .btn-check input) */
.btn-check:focus-visible + .btn-hrp-opt {
  outline: 3px solid var(--hrp-focus); outline-offset: 2px; box-shadow: none;
}

.hrp-cat-icon { font-size: 20px; color: var(--hrp-primary); }

/* =========================================================
   Radio buttons
   ========================================================= */

.hrp-radio-grid .btn-hrp-opt::before {
  content: "";
  flex: none;
  width: 22px;
  height: 22px;
  margin-right: 13px;

  border: 2px solid var(--hrp-radio-bd);
  border-radius: 50%;
  background: #fff;

  transition:
    border-color .12s,
    box-shadow .12s,
    background .12s;
}

.hrp-radio-grid .btn-check:checked + .btn-hrp-opt::before {
  border-color: var(--hrp-primary);
  background: var(--hrp-primary);
  box-shadow: inset 0 0 0 4px #fff;
}

/* =========================================================
   Checkboxes
   ========================================================= */

.hrp-checkbox-grid .btn-hrp-opt {
  position: relative;
}

.hrp-checkbox-grid .btn-hrp-opt::before {
  content: "";
  flex: none;
  width: 22px;
  height: 22px;
  margin-right: 13px;

  border: 2px solid var(--hrp-radio-bd);
  border-radius: 4px;
  background: #fff;

  transition:
    border-color .12s,
    background .12s;
}

.hrp-checkbox-grid .btn-check:checked + .btn-hrp-opt::before {
  background: var(--hrp-primary);
  border-color: var(--hrp-primary);
}

.hrp-checkbox-grid .btn-check:checked + .btn-hrp-opt::after {
  content: "";

  position: absolute;

  left: 24px;
  top: 50%;

  width: 6px;
  height: 11px;

  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;

  transform: translateY(-65%) rotate(45deg);
}

/* ---- Buttons -------------------------------------------------------*/
.hrp-btn-primary {
  min-height: 60px; font-size: clamp(18px, 5vw, 21px); font-weight: 800; color: #fff;
  background: var(--hrp-primary); border: none; border-radius: 12px;
}
.hrp-btn-primary:hover, .hrp-btn-primary:focus { background: var(--hrp-primary-d); color: #fff; }
.hrp-btn-ghost {
  min-height: 56px; padding: 0 24px; font-size: clamp(18px, 4.6vw, 20px); font-weight: 700;
  color: var(--hrp-primary); background: transparent; border: 2px solid #cdd9e0; border-radius: 12px;
}
.hrp-btn-ghost:hover { background: #eef4f7; }
.hrp-btn-outline {
  min-height: 60px; font-size: clamp(18px, 4.8vw, 20px); font-weight: 800;
  color: var(--hrp-primary); background: #fff; border: 2px solid var(--hrp-primary); border-radius: 12px;
}
.hrp-btn-outline:hover { background: #eef4f7; }
.btn:focus-visible { outline: 3px solid var(--hrp-focus); outline-offset: 2px; box-shadow: none; }

.hrp-actions { display: flex; flex-wrap: wrap-reverse; gap: 14px; align-items: center; margin-top: 4px; }
.hrp-grow { flex: 1 1 240px; }
.hrp-page > .hrp-btn-primary { width: 100%; max-width: 420px; }

/* ---- Warning -------------------------------------------------------*/
.hrp-warning {
  background: #fbeed9; border: 1px solid #eccf9c; color: #9a5a14;
  border-radius: 12px; padding: 14px 18px; font-size: clamp(18px, 4vw, 19px); margin: 4px 0 22px;
}

/* ---- Result --------------------------------------------------------*/
.hrp-badge {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid; padding: 9px 20px; border-radius: 30px;
  font-size: clamp(18px, 5vw, 20px); font-weight: 800; margin-top: 4px;
}
.hrp-dot { width: 13px; height: 13px; border-radius: 50%; display: inline-block; }
.hrp-result-line { font-size: clamp(18px, 4.8vw, 21px); font-weight: 700; color: var(--hrp-ink); margin: 16px 0 0; text-wrap: pretty; }
.hrp-section-title { font-size: clamp(18px, 4.8vw, 19px); font-weight: 800; color: var(--hrp-primary); margin: 0 0 14px; }

.hrp-rec-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.hrp-rec { display: flex; gap: 14px; align-items: flex-start; font-size: clamp(18px, 4.4vw, 20px); color: #4f483f; }
.hrp-rec-tick {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: #e3f1e9; color: #258958; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 800; margin-top: 1px;
}
.hrp-rec-title { font-weight: 800; color: var(--hrp-ink); }

.hrp-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 24px 0 32px;
}
.hrp-summary-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 10px;
  background: var(--hrp-surface);
  border: 2px solid var(--hrp-border);
  border-radius: 14px;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
}
.hrp-summary-item i { font-size: 22px; color: var(--hrp-primary); }

/* =========================================================
   Results Accordion
   ========================================================= */

.accordion-item {
  background: var(--hrp-surface);
  border: 1px solid var(--hrp-border) !important;
  border-radius: 16px !important;
  overflow: hidden;
  margin-bottom: 12px;
}

.accordion-button {
  min-height: 72px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--hrp-ink);
  background: #fffdfa;
}

.accordion-title {
    flex: 1 1 auto !important;
}

.accordion-button:not(.collapsed) {
  background: #eef4f7;
  color: var(--hrp-ink);
}

.accordion-button:focus-visible {
  outline: 3px solid var(--hrp-focus);
  outline-offset: -3px;   /* inset, since the button already fills to the card edge */
  box-shadow: none;
  border-color: var(--hrp-focus);
}

.accordion-body {
  font-size: 1.1rem;
  line-height: 1.8;
}

.accordion-body p {
  margin-bottom: 1rem;
}

/* ---- Footer --------------------------------------------------------*/
.hrp-footer { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--hrp-radio-bd); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hrp-footer-label { font-size: 14px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #a39a8c; }
.hrp-footer-org { font-size: clamp(18px, 5vw, 20px); font-weight: 800; color: var(--hrp-ink); }



/* ---- Reduced motion ------------------------------------------------*/
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
