/* ── Government form styles ───────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:wght@400;600;700&family=DM+Sans:wght@400;500;600&display=swap');

.form-root {
    min-height: 100vh;
    background: #f4f4f1;
    font-family: 'DM Sans', sans-serif;
    color: #1a1a1a;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.form-header {
    background: #002b5c;
    border-bottom: 4px solid #e8a000;
}
.header-inner {
    max-width: 1100px; margin: 0 auto;
    padding: 14px 24px;
    display: flex; align-items: center; justify-content: space-between;
}
.gov-wordmark { display: flex; align-items: center; gap: 14px; }
.ns-bar {
    width: 4px; height: 40px;
    background: #e8a000;
    border-radius: 2px;
}
.gov-text { display: flex; flex-direction: column; }
.gov-province { font-size: 16px; font-weight: 700; color: #fff; letter-spacing: -0.3px; font-family: 'Source Serif 4', serif; }
.gov-dept { font-size: 11px; color: #8ab4d8; letter-spacing: 0.2px; }
.admin-link { font-size: 12px; color: #8ab4d8; text-decoration: none; }
.admin-link:hover { color: #fff; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.form-hero {
    background: #002b5c;
    padding: 32px 0 28px;
}
.hero-inner { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.program-badge {
    display: inline-block;
    background: #e8a000; color: #002b5c;
    font-size: 11px; font-weight: 700;
    padding: 3px 10px; border-radius: 2px;
    letter-spacing: 0.8px; text-transform: uppercase;
    margin-bottom: 10px;
}
.hero-title {
    font-family: 'Source Serif 4', serif;
    font-size: 30px; font-weight: 700;
    color: #fff; letter-spacing: -0.5px;
    margin: 0 0 4px;
}
.hero-sub { font-size: 14px; color: #8ab4d8; margin: 0; }

/* ── Progress ─────────────────────────────────────────────────────────────── */
.progress-wrap {
    background: #fff;
    border-bottom: 1px solid #ddd;
    padding: 0;
}
.progress-inner {
    max-width: 1100px; margin: 0 auto;
    padding: 0 24px;
    display: flex; align-items: center;
}
.progress-step {
    display: flex; align-items: center; gap: 8px;
    padding: 14px 0;
    font-size: 12px; font-weight: 600;
    color: #999;
    cursor: default;
}
.step-active { color: #002b5c; }
.step-done   { color: #2a7d4f; }
.step-circle {
    width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    background: #e8e8e4; color: #999;
    flex-shrink: 0;
}
.step-active .step-circle { background: #002b5c; color: #fff; }
.step-done   .step-circle { background: #2a7d4f; color: #fff; }
.step-label { white-space: nowrap; }
.step-line {
    flex: 1; height: 1px;
    background: #ddd; margin: 0 8px;
    min-width: 20px;
}
.line-done { background: #2a7d4f; }

/* ── Body layout ──────────────────────────────────────────────────────────── */
.form-body {
    max-width: 1100px; margin: 32px auto;
    padding: 0 24px 60px;
    display: flex; gap: 28px; align-items: flex-start;
}
.form-card {
    flex: 1; background: #fff;
    border: 1px solid #ddd;
    border-top: 4px solid #002b5c;
    min-width: 0;
}
.step-content { padding: 32px; }
.step-header { margin-bottom: 28px; }
.step-header h2 {
    font-family: 'Source Serif 4', serif;
    font-size: 22px; font-weight: 700;
    color: #002b5c; margin: 0 0 6px;
}
.step-header p { font-size: 14px; color: #555; margin: 0; }

/* ── Fields ───────────────────────────────────────────────────────────────── */
.field-group { margin-bottom: 22px; }
.field-row-2 {
    display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.field-label {
    display: block; font-size: 13px; font-weight: 600;
    color: #1a1a1a; margin-bottom: 6px;
}
.field-label.required::after {
    content: " *"; color: #c00;
}
.field-hint { font-weight: 400; color: #666; font-size: 12px; }
.field-hint-block {
    font-size: 13px; color: #555; margin-bottom: 8px; line-height: 1.5;
}
.field-input, .field-select, .field-textarea {
    width: 100%; padding: 10px 12px;
    border: 1px solid #aaa; border-radius: 2px;
    font-family: 'DM Sans', sans-serif; font-size: 14px;
    color: #1a1a1a; background: #fff;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.field-input:focus, .field-select:focus, .field-textarea:focus {
    outline: none; border-color: #002b5c;
    box-shadow: 0 0 0 2px rgba(0,43,92,0.12);
}
.field-textarea { resize: vertical; }
.input-error { border-color: #c00 !important; }
.error-msg { font-size: 12px; color: #c00; margin-top: 4px; display: block; }
.char-count { font-size: 11px; color: #999; float: right; margin-top: 3px; }

.input-prefix-wrap { position: relative; }
.input-prefix {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    font-size: 14px; color: #555;
}
.input-prefixed { padding-left: 24px; }
.funding-pct { font-size: 12px; color: #2a7d4f; font-weight: 600; margin-top: 4px; display: block; }

/* Radio cards */
.radio-group { display: flex; flex-direction: column; gap: 8px; }
.radio-card {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 14px; border: 1px solid #ccc; border-radius: 2px;
    cursor: pointer; transition: all 0.15s; background: #fafaf8;
}
.radio-card:hover { border-color: #002b5c; background: #f0f4fa; }
.radio-selected { border-color: #002b5c !important; background: #eef3fb !important; }
.radio-card input[type="radio"] { margin-top: 2px; accent-color: #002b5c; }
.radio-content { display: flex; flex-direction: column; gap: 2px; }
.radio-title { font-size: 14px; font-weight: 600; color: #1a1a1a; }
.radio-desc { font-size: 12px; color: #666; }

/* Checkbox cards */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; }
.checkbox-card {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; border: 1px solid #ccc; border-radius: 2px;
    cursor: pointer; transition: all 0.15s; background: #fafaf8;
    font-size: 13px; font-weight: 500;
}
.checkbox-card:hover { border-color: #002b5c; }
.checkbox-selected { border-color: #002b5c; background: #eef3fb; color: #002b5c; }
.checkbox-card input[type="checkbox"] { accent-color: #002b5c; }

/* Toggle */
.toggle-row { display: flex; gap: 8px; }
.toggle-opt {
    padding: 10px 18px; border: 1px solid #ccc; border-radius: 2px;
    cursor: pointer; font-size: 13px; font-weight: 500;
    transition: all 0.15s; background: #fafaf8;
}
.toggle-opt:hover { border-color: #002b5c; }
.toggle-active { border-color: #002b5c; background: #eef3fb; color: #002b5c; font-weight: 600; }

/* Score preview */
.score-preview {
    margin-top: 24px; padding: 16px;
    background: #f0f4fa; border: 1px solid #b8cde8; border-radius: 2px;
}
.score-preview-label { font-size: 12px; font-weight: 600; color: #002b5c; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.score-preview-bar { height: 8px; background: #ddd; border-radius: 2px; overflow: hidden; margin-bottom: 6px; }
.score-preview-fill { height: 100%; background: #002b5c; border-radius: 2px; transition: width 0.5s ease; }
.score-preview-num { font-size: 13px; font-weight: 700; color: #002b5c; }

/* Review */
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.review-section {
    background: #fafaf8; border: 1px solid #ddd; padding: 16px;
}
.review-section.full-width { grid-column: 1 / -1; }
.review-section-title {
    font-size: 11px; font-weight: 700; color: #002b5c;
    text-transform: uppercase; letter-spacing: 0.8px;
    margin-bottom: 10px; padding-bottom: 6px;
    border-bottom: 1px solid #ddd;
}
.review-row {
    display: flex; justify-content: space-between;
    font-size: 13px; padding: 4px 0;
    border-bottom: 1px solid #eee;
}
.review-row span { color: #666; }
.review-row strong { color: #1a1a1a; text-align: right; max-width: 60%; }
.review-text { font-size: 13px; color: #333; line-height: 1.6; margin: 0; }

/* Declaration */
.declaration-box {
    margin-top: 20px; padding: 16px;
    background: #fffbf0; border: 1px solid #e8a000;
}
.declaration-label {
    display: flex; align-items: flex-start; gap: 10px;
    font-size: 13px; color: #333; line-height: 1.5; cursor: pointer;
}
.declaration-label input { margin-top: 2px; accent-color: #002b5c; flex-shrink: 0; }

/* Ineligible */
.ineligible-box {
    padding: 28px; background: #fff8f0;
    border: 1px solid #e8a000; text-align: center;
}
.ineligible-icon { font-size: 32px; margin-bottom: 12px; }
.ineligible-box h3 { font-family: 'Source Serif 4', serif; color: #7a4000; margin: 0 0 8px; }
.ineligible-box p  { font-size: 14px; color: #555; margin: 0 0 16px; }

/* Navigation */
.form-nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 32px;
    border-top: 1px solid #e8e8e4;
    background: #fafaf8;
}
.btn-primary {
    padding: 11px 24px; background: #002b5c; color: #fff;
    border: none; border-radius: 2px; cursor: pointer;
    font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 600;
    transition: background 0.15s;
}
.btn-primary:hover:not(:disabled) { background: #003d80; }
.btn-primary:disabled { background: #aaa; cursor: default; }
.btn-back {
    padding: 11px 20px; background: transparent; color: #555;
    border: 1px solid #ccc; border-radius: 2px; cursor: pointer;
    font-family: 'DM Sans', sans-serif; font-size: 14px;
    transition: all 0.15s;
}
.btn-back:hover { border-color: #002b5c; color: #002b5c; }
.btn-submit {
    padding: 12px 32px; background: #2a7d4f; color: #fff;
    border: none; border-radius: 2px; cursor: pointer;
    font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 700;
    letter-spacing: 0.3px; transition: background 0.15s;
}
.btn-submit:hover:not(:disabled) { background: #1f5e3a; }
.btn-submit:disabled { background: #aaa; cursor: default; }
.btn-secondary {
    padding: 10px 22px; background: #fff; color: #002b5c;
    border: 1px solid #002b5c; border-radius: 2px; cursor: pointer;
    font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 600;
    margin-top: 16px; transition: all 0.15s;
}
.btn-secondary:hover { background: #eef3fb; }

/* Success */
.success-state {
    padding: 48px 32px; text-align: center;
}
.success-icon {
    width: 60px; height: 60px; border-radius: 50%;
    background: #2a7d4f; color: #fff;
    font-size: 28px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
}
.success-state h2 { font-family: 'Source Serif 4', serif; font-size: 24px; color: #002b5c; margin: 0 0 8px; }
.success-state p  { font-size: 14px; color: #555; max-width: 480px; margin: 0 auto 16px; }
.ref-box {
    display: inline-flex; flex-direction: column; gap: 4px;
    padding: 14px 28px; background: #f0f4fa;
    border: 1px solid #b8cde8; margin: 8px 0 20px;
}
.ref-label { font-size: 11px; color: #666; text-transform: uppercase; letter-spacing: 0.8px; }
.ref-num { font-size: 22px; font-weight: 700; color: #002b5c; letter-spacing: 2px; font-family: monospace; }
.success-note { font-size: 13px; color: #777; }

/* Side panel */
.side-panel { width: 280px; flex-shrink: 0; }
.side-card {
    background: #fff; border: 1px solid #ddd;
    border-top: 4px solid #e8a000;
    padding: 20px;
    position: sticky; top: 20px;
}
.side-title { font-size: 11px; font-weight: 700; color: #002b5c; text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 8px; }
.side-card p { font-size: 13px; color: #555; line-height: 1.5; margin: 0 0 12px; }
.side-card a { color: #002b5c; }
.side-divider { height: 1px; background: #e8e8e4; margin: 14px 0; }
.funding-range { display: flex; flex-direction: column; gap: 0; }
.range-row {
    display: flex; justify-content: space-between;
    font-size: 12px; padding: 5px 0;
    border-bottom: 1px solid #eee;
    color: #444;
}
.range-row strong { color: #002b5c; }
.range-total {
    display: flex; justify-content: space-between;
    font-size: 13px; font-weight: 700; padding: 8px 0 4px;
    color: #002b5c;
}

@media (max-width: 768px) {
    .form-body { flex-direction: column; }
    .side-panel { width: 100%; }
    .field-row-2 { grid-template-columns: 1fr; }
    .review-grid { grid-template-columns: 1fr; }
    .step-label { display: none; }
    .side-card { position: static; }
}
