:root {
    --navy: #1b3a6b;
    --navy-2: #285a93;
    --ink: #172033;
    --muted: #657084;
    --line: #e2e8f0;
    --page: #f4f7fb;
    --card: #ffffff;
    --green: #22863a;
    --amber: #a66b00;
    --red: #b42318;
    --shadow: 0 14px 40px rgba(27, 58, 107, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: 'Poppins', Arial, sans-serif;
}
button, input, select, textarea { font: inherit; }
a { color: inherit; }

.site-nav {
    position: sticky;
    top: 0;
    z-index: 80;
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 10px clamp(18px, 4vw, 48px);
    background: var(--navy);
    color: #fff;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .18);
}
.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #fff;
    text-decoration: none;
}
.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #fff;
    color: var(--navy);
    font-weight: 800;
    letter-spacing: -.5px;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; }
.brand small { margin-top: 1px; font-size: 10px; opacity: .72; }
.site-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    flex-wrap: wrap;
}
.site-links > a,
.site-links form button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    border: 0;
    border-radius: 8px;
    padding: 8px 12px;
    background: transparent;
    color: rgba(255,255,255,.84);
    text-decoration: none;
    font-size: 12px;
    cursor: pointer;
}
.site-links > a:hover,
.site-links form button:hover { background: rgba(255,255,255,.12); color: #fff; }
.site-links > a.active { background: rgba(255,255,255,.13); color: #fff; }
.nav-button-outline { border: 1px solid rgba(255,255,255,.4) !important; }
.nav-button-light { background: #fff !important; color: var(--navy) !important; font-weight: 700; }

.site-footer {
    padding: 28px 24px;
    background: var(--navy);
    color: rgba(255,255,255,.72);
    font-size: 12px;
    line-height: 1.8;
    text-align: center;
}
.site-footer a { color: rgba(255,255,255,.86); text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer .footer-logo { margin-bottom: 5px; color: #fff; font-size: 14px; font-weight: 700; }

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}
.page-section { padding: 48px 0; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 11px;
    border-radius: 999px;
    background: #eaf1fb;
    color: var(--navy);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .35px;
    text-transform: uppercase;
}
.muted { color: var(--muted); }

.product-hero {
    position: relative;
    overflow: hidden;
    padding: 62px 0;
    background:
        radial-gradient(circle at 90% 12%, rgba(255,255,255,.13), transparent 28%),
        radial-gradient(circle at 5% 95%, rgba(255,255,255,.08), transparent 28%),
        linear-gradient(135deg, #173764, #28609b);
    color: #fff;
}
.product-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, .8fr);
    gap: 44px;
    align-items: center;
}
.product-hero h1 {
    margin: 15px 0 16px;
    max-width: 760px;
    font-size: clamp(34px, 5vw, 54px);
    line-height: 1.08;
    letter-spacing: -1.5px;
}
.product-hero p {
    max-width: 700px;
    margin: 0 0 24px;
    color: rgba(255,255,255,.82);
    line-height: 1.8;
    font-size: 14px;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 9px;
    padding: 10px 17px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: #14305a; box-shadow: 0 8px 20px rgba(27,58,107,.20); }
.btn-light { background: #fff; color: var(--navy); }
.btn-outline-light { border-color: rgba(255,255,255,.45); background: rgba(255,255,255,.08); color: #fff; }
.btn-outline { border-color: #c7d3e3; background: #fff; color: var(--navy); }
.btn-danger { background: #fff1f0; color: var(--red); border-color: #ffd2cc; }
.btn-small { min-height: 34px; padding: 7px 11px; font-size: 11px; }

.hero-stats { display: grid; gap: 12px; }
.hero-stat {
    padding: 19px 20px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 13px;
    background: rgba(255,255,255,.10);
    backdrop-filter: blur(6px);
}
.hero-stat strong { display: block; font-size: 27px; line-height: 1; }
.hero-stat span { display: block; margin-top: 7px; color: rgba(255,255,255,.72); font-size: 11px; }

.section-title { margin: 0 0 7px; color: var(--navy); font-size: 25px; }
.section-subtitle { margin: 0 0 28px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.steps-grid, .features-grid, .dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.step-card, .feature-card, .panel, .review-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
    box-shadow: 0 5px 18px rgba(27,58,107,.05);
}
.step-card, .feature-card { padding: 22px; }
.step-number {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: #e8f0fb;
    color: var(--navy);
    font-weight: 800;
}
.step-card h3, .feature-card h3 { margin: 15px 0 7px; color: var(--navy); font-size: 14px; }
.step-card p, .feature-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.features-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.feature-icon { font-size: 22px; }
.standards-cloud { display: flex; gap: 8px; flex-wrap: wrap; }
.standards-cloud span {
    padding: 7px 11px;
    border: 1px solid #dbe5f2;
    border-radius: 999px;
    background: #fff;
    color: #40506a;
    font-size: 11px;
}
.access-band {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: center;
    padding: 30px;
    border-radius: 18px;
    background: var(--navy);
    color: #fff;
    box-shadow: var(--shadow);
}
.access-band h2 { margin: 0 0 8px; font-size: 22px; }
.access-band p { margin: 0; color: rgba(255,255,255,.72); font-size: 13px; }

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    padding: 38px 0 24px;
}
.page-header h1 { margin: 8px 0 4px; color: var(--navy); font-size: 30px; }
.page-header p { margin: 0; color: var(--muted); font-size: 13px; }

.panel { padding: 20px; }
.panel h2 { margin: 0 0 14px; color: var(--navy); font-size: 17px; }
.dashboard-grid { grid-template-columns: 1fr 1.7fr; align-items: start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { color: #44516a; font-size: 11px; font-weight: 700; }
.field input, .field select, .field textarea {
    width: 100%;
    border: 1px solid #ccd7e6;
    border-radius: 8px;
    padding: 10px 11px;
    background: #fff;
    color: var(--ink);
    outline: none;
    font-size: 13px;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(40,90,147,.10); }
.field-error { color: var(--red); font-size: 11px; }

.alert { padding: 12px 16px; border-radius: 10px; font-size: 12.5px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-success { background: #eaf7ee; border-color: #bfe6cb; color: #1c6b34; }
.alert-error { background: #fff1f0; border-color: #ffd2cc; color: var(--red); }
.form-actions { display: flex; gap: 9px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.form-message { min-height: 18px; color: var(--muted); font-size: 11px; }
.form-message.error { color: var(--red); }

.review-list { display: grid; gap: 11px; }
.review-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 16px 18px;
}
.review-card h3 { margin: 0 0 4px; color: var(--navy); font-size: 14px; }
.review-meta { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 10.5px; }
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: #edf3fb;
    color: var(--navy);
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.badge.green { background: #e7f6eb; color: var(--green); }
.badge.amber { background: #fff4dc; color: var(--amber); }
.badge.red { background: #fff0ee; color: var(--red); }
.empty-state { padding: 44px 20px; text-align: center; color: var(--muted); }

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: none;
    place-items: center;
    padding: 18px;
    background: rgba(11, 22, 40, .58);
    backdrop-filter: blur(3px);
}
.modal-backdrop.open { display: grid; }
.modal-card {
    width: min(500px, 100%);
    border-radius: 15px;
    background: #fff;
    padding: 24px;
    box-shadow: 0 24px 70px rgba(0,0,0,.24);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.modal-head h2 { margin: 0; color: var(--navy); font-size: 18px; }
.modal-close { border: 0; background: transparent; color: #7b8799; font-size: 22px; cursor: pointer; }

/* Workspace */
.workspace-body { overflow: hidden; }
.workspace-shell { height: 100vh; display: grid; grid-template-rows: auto 1fr auto; background: #eef3f8; }
.workspace-topbar {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 9px 18px;
    background: var(--navy);
    color: #fff;
}
.workspace-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.workspace-back { color: rgba(255,255,255,.82); text-decoration: none; font-size: 12px; }
.workspace-title h1 { margin: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workspace-title small { display: block; margin-top: 2px; opacity: .65; font-size: 10px; }
.workspace-progress { display: flex; align-items: center; gap: 9px; min-width: 280px; }
.workspace-progress-track { flex: 1; height: 6px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.22); }
.workspace-progress-fill { height: 100%; width: 0; background: #59c36a; transition: width .25s ease; }
.save-state { min-width: 90px; font-size: 10px; color: rgba(255,255,255,.68); text-align: right; }
.demo-strip { padding: 7px 14px; background: #8a6508; color: #fff; text-align: center; font-size: 10.5px; font-weight: 700; }
.workspace-main { min-height: 0; display: grid; grid-template-columns: 275px 1fr; }
.workspace-sidebar { min-height: 0; overflow: auto; background: #173764; color: #fff; }
.workspace-side-head { padding: 15px 16px 10px; border-bottom: 1px solid rgba(255,255,255,.08); }
.workspace-side-head strong { display: block; font-size: 12px; }
.workspace-side-head button { margin-top: 7px; border: 0; background: transparent; color: rgba(255,255,255,.7); padding: 0; font-size: 10px; cursor: pointer; }
.standard-nav-item {
    width: 100%;
    display: grid;
    grid-template-columns: 22px 1fr auto;
    gap: 8px;
    align-items: center;
    border: 0;
    border-left: 3px solid transparent;
    padding: 10px 12px;
    background: transparent;
    color: rgba(255,255,255,.78);
    text-align: left;
    cursor: pointer;
}
.standard-nav-item:hover { background: rgba(255,255,255,.07); }
.standard-nav-item.active { background: rgba(255,255,255,.13); border-left-color: #59c36a; color: #fff; }
.standard-nav-item .code { font-size: 10px; font-weight: 700; }
.standard-nav-item .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; }
.standard-nav-item .status { font-size: 9px; opacity: .65; }
.workspace-content { min-height: 0; overflow: auto; padding: 24px 28px 70px; }
.review-section { width: min(860px, 100%); margin: 0 auto; }
.review-section h2 { margin: 0 0 5px; color: var(--navy); font-size: 21px; }
.review-section > p { margin: 0 0 20px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.question-group-title { margin: 23px 0 10px; padding-bottom: 6px; border-bottom: 2px solid #dce6f2; color: var(--navy); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.question-card {
    margin-bottom: 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    padding: 15px 16px;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.question-card:hover { border-color: #b9c8da; box-shadow: 0 5px 18px rgba(27,58,107,.06); }
.question-card.is-hidden { display: none; }
.question-ref { margin-bottom: 4px; color: #3f78aa; font-size: 9.5px; font-weight: 800; text-transform: uppercase; }
.question-text { color: #202a3c; font-size: 12.5px; line-height: 1.58; }
.question-source { margin-top: 6px; color: #8791a1; font-size: 9.5px; font-style: italic; }
.answer-options { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 11px; }
.answer-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #ccd7e5;
    border-radius: 999px;
    padding: 6px 11px;
    background: #fff;
    color: #4d5a70;
    font-size: 10.5px;
    cursor: pointer;
}
.answer-pill input { display: none; }
.answer-pill.selected { background: var(--navy); border-color: var(--navy); color: #fff; }
.comment-wrap { margin-top: 9px; }
.comment-wrap label { display: block; margin-bottom: 4px; color: #6f7a8c; font-size: 9.5px; }
.comment-wrap textarea { width: 100%; min-height: 58px; resize: vertical; border: 1px solid #d3dce8; border-radius: 7px; padding: 8px 9px; font-size: 11px; outline: none; }
.comment-wrap textarea:focus { border-color: var(--navy-2); }
.workspace-footer {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 9px 22px 9px 297px;
    border-top: 1px solid var(--line);
    background: #fff;
}
.workspace-footer-center { color: var(--muted); font-size: 10.5px; }
.loading-card { padding: 50px 20px; text-align: center; color: var(--muted); }
.summary-grid { display: grid; grid-template-columns: 180px 1fr; gap: 18px; margin-bottom: 18px; }
.score-card { display: grid; place-items: center; min-height: 160px; border-radius: 14px; background: var(--navy); color: #fff; }
.score-card strong { display: block; font-size: 33px; text-align: center; }
.score-card span { display: block; margin-top: 5px; color: rgba(255,255,255,.65); font-size: 10px; text-align: center; }
.metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.metric { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.metric strong { display: block; color: var(--navy); font-size: 20px; }
.metric span { color: var(--muted); font-size: 9.5px; }
.exception-list { display: grid; gap: 9px; }
.exception-item { border-left: 3px solid var(--red); border-radius: 8px; background: #fff; padding: 12px 14px; }
.exception-item strong { color: var(--navy); font-size: 11px; }
.exception-item p { margin: 4px 0 0; color: #4e596c; font-size: 10.5px; line-height: 1.55; }

/* Admin */
.admin-shell { display: grid; grid-template-columns: 290px 1fr 330px; gap: 16px; align-items: start; }
.admin-shell-2col { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
.admin-list { max-height: 72vh; overflow: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.admin-table th, .admin-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.admin-table th { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .3px; font-weight: 700; }
.admin-table td.muted { color: var(--muted); text-align: center; }
.admin-standard-item {
    width: 100%;
    display: block;
    border: 0;
    border-bottom: 1px solid #edf1f6;
    padding: 12px;
    background: #fff;
    text-align: left;
    cursor: pointer;
}
.admin-standard-item:hover, .admin-standard-item.active { background: #f1f6fc; }
.admin-standard-item strong { display: block; color: var(--navy); font-size: 11.5px; }
.admin-standard-item span { color: var(--muted); font-size: 9.5px; }
.admin-editor { min-height: 520px; }
.admin-section-block { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.admin-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: #f4f7fb; }
.admin-section-head strong { color: var(--navy); font-size: 11px; }
.admin-question { padding: 11px 12px; border-top: 1px solid var(--line); }
.admin-question:first-child { border-top: 0; }
.admin-question-ref { color: #3f78aa; font-size: 9px; font-weight: 800; }
.admin-question p { margin: 4px 0 7px; color: #344056; font-size: 10.5px; line-height: 1.45; }
.user-results { display: grid; gap: 7px; margin-top: 9px; }
.user-result { border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; background: #fff; cursor: pointer; }
.user-result:hover, .user-result.selected { border-color: var(--navy-2); background: #f3f7fc; }
.user-result strong { display: block; color: var(--navy); font-size: 10.5px; }
.user-result span { color: var(--muted); font-size: 9px; }
.code-output { display: none; margin-top: 12px; border: 1px dashed #9cb2cc; border-radius: 10px; padding: 14px; background: #f6f9fd; }
.code-output.show { display: block; }
.code-output code { display: block; margin: 7px 0; color: var(--navy); font-size: 18px; font-weight: 800; letter-spacing: 1px; }
.code-table { width: 100%; border-collapse: collapse; font-size: 9.5px; }
.code-table th, .code-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.code-table th { color: var(--muted); font-weight: 700; }

.app-toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 200;
    max-width: 360px;
    padding: 11px 14px;
    border-radius: 9px;
    background: #16263d;
    color: #fff;
    box-shadow: 0 12px 32px rgba(0,0,0,.2);
    font-size: 11px;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: .2s ease;
}
.app-toast.show { opacity: 1; transform: translateY(0); }
.app-toast.error { background: var(--red); }

@media (max-width: 980px) {
    .product-hero-grid, .dashboard-grid, .admin-shell, .admin-shell-2col { grid-template-columns: 1fr; }
    .features-grid, .steps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .workspace-main { grid-template-columns: 230px 1fr; }
    .workspace-footer { padding-left: 250px; }
}

@media (max-width: 720px) {
    .site-nav { align-items: flex-start; flex-direction: column; }
    .site-links { width: 100%; justify-content: flex-start; }
    .product-hero { padding: 45px 0; }
    .product-hero-grid, .features-grid, .steps-grid, .form-grid, .summary-grid { grid-template-columns: 1fr; }
    .access-band { grid-template-columns: 1fr; }
    .review-card { grid-template-columns: 1fr; }
    .workspace-body { overflow: auto; }
    .workspace-shell { min-height: 100vh; height: auto; }
    .workspace-main { grid-template-columns: 1fr; }
    .workspace-sidebar { max-height: 220px; }
    .workspace-content { overflow: visible; padding: 20px 14px 90px; }
    .workspace-footer { position: sticky; bottom: 0; padding: 9px 12px; }
    .workspace-progress { min-width: 160px; }
    .workspace-title small { display: none; }
}
