*{box-sizing:border-box}html,body{margin:0;padding:0}body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,'Helvetica Neue',Arial,'Noto Sans',sans-serif;background:#f2f5f9;color:#102a43;line-height:1.5}
main{max-width:860px;margin:1rem auto;padding:0 1rem}
.card{background:#fff;border:1px solid #e6ebf2;border-radius:16px;box-shadow:0 12px 32px rgba(16,42,67,.12);overflow:hidden}
.card .card-head{background:linear-gradient(135deg,#1a365d,#2c5282)!important;color:#fff;padding:1.75rem 1.25rem 1.25rem;display:flex;align-items:center;gap:.75rem}
.card .card-head h1{font-size:1.9rem;margin:0}
/* Joining-style subheader: light background for subtitle + steps */
.card .card-sub{padding:.5rem 0 .75rem;background:#f3f6fb;color:#475569;border-top:1px solid rgba(255,255,255,.15)}
.card .card-sub .inner{padding:0 1.25rem}
.card .card-sub .subtext{margin:.25rem 0 .5rem}
.card .card-body{padding:1.25rem 1.25rem;border-top:1px solid #eef2f7}
label{display:block;margin:.75rem 0 .25rem;font-weight:600}
input,select,textarea{width:100%;padding:.6rem .7rem;border:1px solid #cbd2d9;border-radius:8px;font-size:1rem}
.row{display:grid;grid-template-columns:1fr;gap:12px}
@media(min-width:720px){.row{grid-template-columns:repeat(2,1fr)}}
.actions{display:flex;gap:.75rem;margin-top:1.25rem;padding-top:1.25rem;border-top:1px solid #eef2f7}
.actions #prevBtn[disabled]{visibility:hidden}
button{background:#1f3b69;color:#fff;border:none;border-radius:10px;padding:.75rem 1.15rem;font-weight:700;cursor:pointer;box-shadow:0 4px 10px rgba(16,42,67,.15);transition:background .2s ease,transform .05s ease,box-shadow .2s ease}
button:hover{background:#2a4677}
button:active{transform:translateY(1px);box-shadow:0 3px 8px rgba(16,42,67,.18)}
button:focus{outline:2px solid transparent;box-shadow:0 0 0 3px rgba(31,59,105,.25)}
button:disabled{opacity:.6;cursor:not-allowed;box-shadow:none}
button.secondary{background:#fff;color:#1f3b69;border:2px solid #1f3b69;box-shadow:none}
button.secondary:hover{background:#1f3b69;color:#fff}
.notice{padding:.625rem .75rem;border-radius:8px;background:#eff6ff;color:#1e40af;margin:.5rem 0}
.error{background:#fee2e2;color:#991b1b}
.loading{opacity:.7}
.success{background:#ecfdf5;color:#065f46}
.hidden{display:none}

/* Groups and sections for clearer layout */
.form-section{margin:1rem 0;padding:0.75rem 0;border-top:1px solid #e5e7eb}
.form-section:first-of-type{border-top:none}
.form-section h3{grid-column:1/-1;margin:0 0 .5rem;font-size:1.15rem}

.group{display:flex;flex-direction:column;gap:.5rem}
.group label{font-weight:400;margin:0}
/* Default option layout */
.group .option{display:flex;align-items:center;gap:.5rem}
.group .option label{display:inline;cursor:pointer;margin:0}
/* Grid layout for stacked/long labels to align ticks and text */
.group:not(.inline) .option,
.group.columns-2 .option{display:grid;grid-template-columns:20px 1fr;align-items:start;gap:.5rem}
.group .option input[type=radio],
.group .option input[type=checkbox]{margin-top:2px}
/* Slightly reduce default radio size on some mobile browsers for alignment */
input[type=radio]{transform:scale(.98)}
.inline-help{display:block;color:#64748b;font-size:.9rem;margin:.25rem 0 0}

/* Inline radios for short yes/no style questions */
.group.inline{display:flex;flex-wrap:wrap;gap:1rem}
.group.inline .option{display:inline-flex}

/* Two-column checkbox layout (collapses on small screens) */
.group.columns-2{display:grid;grid-template-columns:1fr 1fr;gap:.5rem 1rem}
.group.columns-2 .option{align-items:flex-start}
@media(max-width:720px){.group.columns-2{grid-template-columns:1fr}}

/* Step header mimic (joining-style) */
.steps{display:flex;gap:1rem;list-style:none;margin:.25rem 0 0;padding:.5rem 1.25rem;background:transparent;justify-content:space-between;position:relative}
.steps li{position:relative;display:flex;flex-direction:column;align-items:center;gap:.35rem;opacity:.9;cursor:pointer;flex:1;z-index:1}
.steps li.active{opacity:1}
/* Connector line positioned between dot edges and layered behind dots */
.steps li + li::before{content:"";position:absolute;top:18px;left:calc(-50% + 18px);width:calc(100% - 36px);height:2px;background:#e5e7eb;z-index:0}
.steps li.completed + li::before,
.steps li.active + li::before{background:#d4af37}
.steps .dot{width:34px;height:34px;border-radius:999px;background:#fff;color:#1f3b69;border:2px solid #cbd5e1;display:inline-flex;align-items:center;justify-content:center;font-weight:700;position:relative;z-index:2;box-shadow:0 0 0 2px rgba(255,255,255,.9)}
.steps li.active .dot{background:#1f3b69;color:#fff;border-color:#1f3b69}
.steps li.completed .dot{background:#d4af37;color:#fff;border-color:#d4af37}
.steps .label{color:#475569;font-size:.85rem;white-space:nowrap}

/* Mobile improvements for steps */
@media(max-width:720px){
  .steps{gap:.75rem;padding:.5rem 1rem}
  .steps .dot{width:28px;height:28px;font-size:.875rem}
  .steps .label{font-size:.8rem}
}

/* Actions row tweaks */
.actions{align-items:center;gap:.75rem}
.actions #prevBtn{order:0}
.actions #nextBtn{order:1}
.actions #submitBtn{order:2}

/* Footer styling */
.site-footer{text-align:center;padding:1rem;color:#64748b;font-size:.875rem}
