:root{
  --bg:#ffffff;--card:#fafafa;--ink:#0f172a;--muted:#64748b;--line:#e2e8f0;--accent:#0ea5e9;--warn:#ef4444;
  --content-max: 1440px;
  --label-col-wide: 520px;
  --label-col-med: 420px;
}
*{box-sizing:border-box}
body{margin:0;font:16px/1.6 system-ui,-apple-system,Segoe UI,Roboto,Inter,Helvetica,Arial,sans-serif;color:var(--ink);background:var(--bg)}
a{color:inherit}

/* Header / container */
header{position:sticky;top:0;background:#fff;border-bottom:1px solid var(--line);z-index:10}
.wrap{max-width:var(--content-max);margin:auto;padding:24px}

/* Typography */
h1{font-size:24px;margin:0 0 6px}
.sub{color:var(--muted);font-size:13px}

/* Grid helpers */
.grid{display:grid;gap:18px}
.g-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.g-3{grid-template-columns:repeat(3,minmax(0,1fr))}
@media (max-width:1360px){.g-3{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:920px){.g-2,.g-3{grid-template-columns:1fr}}

label{display:block;font-weight:600;margin:6px 0}
.prompt{font-weight:600; margin:6px 0; display:block}
.hint{font-size:12px;color:var(--muted);margin-top:2px}
.sr-only{
  position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
  clip:rect(0,0,1px,1px);white-space:nowrap;border:0
}

/* Inputs */
input[type="text"], input[type="email"], input[type="date"], textarea, select{
  width:100%;padding:12px 14px;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--ink);
  font:inherit
}
textarea{min-height:120px;resize:vertical}
input[type="date"]{max-width:260px}
input[type="range"]{width:100%}

/* Radios */
.radios{display:flex;gap:28px;align-items:center;flex-wrap:wrap}
.radios label{font-weight:500;margin:0}

/* Question row layout */
.row{display:grid;grid-template-columns:var(--label-col-wide) 1fr;gap:28px;align-items:flex-start}
@media (max-width:1500px){.row{grid-template-columns:var(--label-col-med) 1fr}}
@media (max-width:960px){.row{grid-template-columns:1fr}}

/* Form chrome */
form{max-width:var(--content-max);margin:24px auto;padding:0 24px 120px}
fieldset{border:1px solid var(--line);border-radius:12px;padding:26px;margin:24px 0;background:var(--card)}
legend{padding:0 8px;font-weight:700;font-size:16px}
.section-note{font-size:13px;color:var(--muted);margin-top:-6px;margin-bottom:10px}
.hr{height:1px;background:var(--line);margin:12px 0 18px}

/* Sticky toolbar */
.toolbar{position:sticky;bottom:0;background:#fff;border-top:1px solid var(--line);
  padding:14px 24px;display:flex;gap:12px;justify-content:flex-end;z-index:20}
button{appearance:none;border:1px solid var(--line);background:#fff;border-radius:12px;padding:12px 16px;cursor:pointer;font-weight:600}
button.primary{background:var(--accent);color:#fff;border-color:var(--accent)}
button.danger{border-color:var(--warn);color:var(--warn)}

/* Home styles (if needed on pages using base.css only) */
.home-body{background-color:powderblue}
.center{text-align:center}
.home-image{width:25%}
.button-container{text-align:center;margin-top:20px}
.grc-button{
  background-color:#0078d7;color:white;border:none;padding:12px 24px;border-radius:8px;
  font-size:16px;cursor:pointer;text-decoration:none;display:inline-block
}
.grc-button:hover{background-color:#005fa3}


/* === GRC tweak (2025-10-13 e): header Home button aligned right === */
body.riskprofile-form header .wrap,
body.risk-form header .wrap{
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 8px 16px;
}
body.riskprofile-form header .wrap h1,
body.risk-form header .wrap h1{ grid-column: 1; margin: 0; }
body.riskprofile-form header .wrap .sub,
body.risk-form header .wrap .sub{ grid-column: 1 / span 2; }
body.riskprofile-form .home-btn,
body.risk-form .home-btn{
  grid-column: 2;
  justify-self: end;
  padding: 8px 14px;
  border: 1px solid var(--ink-3, #333);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}
body.riskprofile-form .home-btn:hover,
body.risk-form .home-btn:hover{ filter: brightness(0.95); }
