/* Warm Roof Fixings Calculator — scoped styles (everything lives under #wrfc) */
#wrfc {
  --wrfc-blue: #004C98;
  --wrfc-navy: #0A2B52;
  --wrfc-navy-2: #0F3A6B;
  --wrfc-copper: #B4642A;
  --wrfc-copper-light: #E7A874;
  --wrfc-steel: #EEF2F7;
  --wrfc-line: #C9D4E1;
  --wrfc-ink: #17233A;
  --wrfc-muted: #5D6B80;
  --wrfc-white: #FFFFFF;
  --wrfc-font: inherit;           /* inherits the site's typeface; set a font stack here to override */
  --wrfc-radius: 6px;

  box-sizing: border-box;
  font-family: var(--wrfc-font);
  color: var(--wrfc-ink);
  line-height: 1.4;
  max-width: 1100px;
  margin: 0 auto;
  -webkit-text-size-adjust: 100%;
}
#wrfc *, #wrfc *::before, #wrfc *::after { box-sizing: inherit; }

/* neutralise theme styling on the controls we own */
#wrfc button, #wrfc select, #wrfc input {
  all: unset;
  box-sizing: border-box;
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.3;
  color: var(--wrfc-ink);
}
#wrfc input::-webkit-outer-spin-button, #wrfc input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#wrfc input[type=number] { -moz-appearance: textfield; }

/* ---- two panels ---- */
#wrfc .wrfc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; align-items: start; }

#wrfc .wrfc-panel { border-radius: var(--wrfc-radius); overflow: hidden; }
#wrfc .wrfc-panel-title { margin: 0; padding: 14px 20px 12px; font-size: 14px; font-weight: 700; letter-spacing: 0.04em; }

/* specification */
#wrfc .wrfc-spec { background: var(--wrfc-steel); border: 1px solid var(--wrfc-line); }
#wrfc .wrfc-spec .wrfc-panel-title { color: var(--wrfc-blue); border-bottom: 1px solid var(--wrfc-line); }
#wrfc .wrfc-row { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 20px; border-bottom: 1px solid rgba(0,0,0,0.06); }
#wrfc .wrfc-row:last-child { border-bottom: 0; padding-bottom: 16px; }
#wrfc .wrfc-row.wrfc-row-stack { grid-template-columns: 1fr; gap: 6px; }
#wrfc .wrfc-label { font-size: 14px; font-weight: 500; color: var(--wrfc-ink); }
#wrfc .wrfc-label small { display: block; font-size: 12px; font-weight: 400; color: var(--wrfc-muted); margin-top: 2px; }
#wrfc .wrfc-control { position: relative; }
#wrfc .wrfc-control select, #wrfc .wrfc-control input {
  background: var(--wrfc-white);
  border: 1px solid var(--wrfc-line);
  border-radius: 4px;
  padding: 9px 12px;
  min-height: 42px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
#wrfc .wrfc-control input { cursor: text; font-variant-numeric: tabular-nums; padding-right: 44px; }
#wrfc .wrfc-unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--wrfc-muted); pointer-events: none; }
#wrfc .wrfc-control select { padding-right: 36px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#wrfc .wrfc-control::after {
  content: ""; position: absolute; right: 13px; top: 50%; width: 9px; height: 9px; margin-top: -7px;
  border-right: 2px solid var(--wrfc-blue); border-bottom: 2px solid var(--wrfc-blue); transform: rotate(45deg); pointer-events: none;
}
#wrfc .wrfc-control.wrfc-number::after { display: none; }
#wrfc .wrfc-control select:hover, #wrfc .wrfc-control input:hover { border-color: #9FB0C6; }
#wrfc .wrfc-control select:focus-visible, #wrfc .wrfc-control input:focus-visible { border-color: var(--wrfc-blue); box-shadow: 0 0 0 3px rgba(0,76,152,0.18); outline: none; }

/* offer plate */
#wrfc .wrfc-offer { background: var(--wrfc-navy); color: var(--wrfc-white); border: 1px solid var(--wrfc-navy); }
#wrfc .wrfc-offer .wrfc-panel-title { color: #BFD3EC; border-bottom: 1px solid rgba(255,255,255,0.12); }
#wrfc .wrfc-out { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 13px 20px; border-bottom: 1px solid rgba(255,255,255,0.10); }
#wrfc .wrfc-out dt { font-size: 14px; color: #D6E2F1; margin: 0; }
#wrfc .wrfc-out dt small { display: block; font-size: 12px; color: #9DB3CF; margin-top: 1px; }
#wrfc .wrfc-out dd { margin: 0; font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; transition: color .35s ease; }
#wrfc .wrfc-out dd.wrfc-flash { color: var(--wrfc-copper-light); }
#wrfc dl { margin: 0; }

#wrfc .wrfc-product { padding: 20px 20px 18px; background: var(--wrfc-navy-2); border-bottom: 1px solid rgba(255,255,255,0.10); }
#wrfc .wrfc-product-label { font-size: 14px; color: #D6E2F1; margin: 0 0 4px; }
#wrfc .wrfc-product-code { margin: 0; font-size: clamp(36px, 4.5vw, 46px); line-height: 1.05; font-weight: 700; color: var(--wrfc-copper-light); letter-spacing: 0.01em; font-variant-numeric: tabular-nums; transition: color .35s ease; }
#wrfc .wrfc-product-code.wrfc-flash { color: var(--wrfc-white); }
#wrfc .wrfc-boxed { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px 20px 18px; border-bottom: 1px solid rgba(255,255,255,0.10); }
#wrfc .wrfc-boxed dt { font-size: 15px; font-weight: 600; color: var(--wrfc-white); }
#wrfc .wrfc-boxed dd { margin: 0; font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; transition: color .35s ease; }
#wrfc .wrfc-boxed dd.wrfc-flash { color: var(--wrfc-copper-light); }

/* actions */
#wrfc .wrfc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px 20px 18px; }
#wrfc .wrfc-actions .wrfc-primary { grid-column: 1 / -1; }
#wrfc .wrfc-actions button {
  border: 1px solid rgba(255,255,255,0.35); border-radius: 4px; padding: 10px 12px; font-size: 14px; font-weight: 500;
  color: var(--wrfc-white); text-align: center; cursor: pointer; background: transparent; transition: background .15s ease, border-color .15s ease;
}
#wrfc .wrfc-actions button:hover { background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.6); }
#wrfc .wrfc-actions button:focus-visible { outline: 2px solid var(--wrfc-copper-light); outline-offset: 2px; }
#wrfc .wrfc-actions button.wrfc-primary { background: var(--wrfc-copper); border-color: var(--wrfc-copper); }
#wrfc .wrfc-actions button.wrfc-primary:hover { background: #9E5623; border-color: #9E5623; }
#wrfc .wrfc-toast { padding: 0 20px 16px; font-size: 13px; color: #BFD3EC; min-height: 16px; }

/* footnote */
#wrfc .wrfc-note { margin: 16px 0 0; font-size: 13px; color: var(--wrfc-muted); max-width: 90ch; }

@media (max-width: 560px) {
  #wrfc .wrfc-row { grid-template-columns: 1fr; gap: 6px; }
  #wrfc .wrfc-out dd { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  #wrfc * { transition: none !important; }
}
