:root {
    --ink: #102033;
    --muted: #667085;
    --line: #d9e1ea;
    --panel: #ffffff;
    --bg: #f4f7fb;
    --navy: #0b2a4a;
    --blue: #1769e0;
    --green: #16845b;
    --amber: #b86a00;
    --red: #b42318;
    --focus: #6aa7ff;
    --shadow: 0 18px 50px rgba(16, 32, 51, .12);
}

* { box-sizing: border-box; }

html {
    min-height: 100%;
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
}

a {
    color: var(--blue);
    text-decoration: none;
}

a:hover { text-decoration: underline; }

img { max-width: 100%; }

label {
    display: grid;
    gap: 7px;
    font-weight: 700;
    color: var(--ink);
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 12px;
    color: var(--ink);
    background: #fff;
    font: inherit;
}

textarea { resize: vertical; }

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid color-mix(in srgb, var(--focus) 30%, transparent);
    border-color: var(--focus);
}

button,
.primary-btn,
.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: 8px;
    border: 1px solid transparent;
    padding: 11px 16px;
    font-weight: 800;
    font: inherit;
    cursor: pointer;
}

.primary-btn {
    background: var(--blue);
    color: #fff;
    box-shadow: 0 10px 18px rgba(23, 105, 224, .18);
}

.secondary-btn {
    background: #fff;
    border-color: var(--line);
    color: var(--ink);
}

button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.link-btn {
    border: 0;
    background: transparent;
    color: var(--blue);
    padding: 0;
    min-height: auto;
}

.danger { color: var(--red); }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px clamp(18px, 4vw, 48px);
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.topbar img { width: 190px; }

.candidate-shell {
    width: min(900px, calc(100% - 28px));
    margin: 0 auto;
    padding: 26px 0 56px;
}

.hero-band,
.job-summary,
.success-panel {
    background: linear-gradient(135deg, #0b2a4a, #164b77);
    color: #fff;
    border-radius: 12px;
    padding: clamp(26px, 6vw, 54px);
    box-shadow: var(--shadow);
}

.hero-band h1,
.job-summary h1,
.success-panel h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1;
    letter-spacing: 0;
}

.hero-band p,
.job-summary p,
.success-panel p {
    max-width: 660px;
    color: rgba(255, 255, 255, .82);
    font-size: 1.08rem;
}

.eyebrow {
    margin: 0 0 10px;
    color: #4b77a8;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: .78rem;
}

.hero-band .eyebrow,
.job-summary .eyebrow,
.success-panel .eyebrow {
    color: #bfe1ff;
}

.job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.job-meta span {
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    padding: 7px 11px;
    color: #fff;
}

.job-description-toggle {
    margin-top: 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(16, 32, 51, .06);
    overflow: hidden;
}

.job-description-toggle summary {
    cursor: pointer;
    list-style: none;
    padding: 16px 18px;
    font-weight: 900;
    color: var(--ink);
}

.job-description-toggle summary::-webkit-details-marker { display: none; }

.job-description-toggle summary::after {
    content: "+";
    float: right;
    color: var(--blue);
    font-weight: 900;
}

.job-description-toggle[open] summary::after { content: "-"; }

.job-description-toggle div {
    border-top: 1px solid var(--line);
    padding: 16px 18px 18px;
    color: var(--muted);
    line-height: 1.55;
    white-space: normal;
}

.candidate-card,
.interview-form,
.stacked-form {
    display: grid;
    gap: 16px;
}

.candidate-card,
.question-card,
.panel,
.login-card,
.install-shell {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(16, 32, 51, .07);
}

.candidate-card {
    margin-top: 18px;
    padding: clamp(18px, 4vw, 30px);
}

.interview-form { margin-top: 18px; }

.question-card {
    position: relative;
    padding: clamp(18px, 4vw, 30px);
}

.question-number {
    position: absolute;
    top: 18px;
    right: 18px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e9f2ff;
    color: var(--blue);
    font-weight: 900;
}

.question-card label > span {
    display: block;
    max-width: calc(100% - 48px);
    font-size: 1.05rem;
    line-height: 1.35;
}

.question-card em,
.hint,
.muted,
td span {
    color: var(--muted);
    font-style: normal;
    font-size: .92rem;
}

.choice-row,
.checkbox-row,
.checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.choice-row label,
.checkbox-grid label,
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    font-weight: 700;
}

.choice-row input,
.checkbox-grid input,
.checkbox-row input {
    width: auto;
    min-height: auto;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.sticky-submit {
    position: sticky;
    bottom: 14px;
    width: 100%;
    z-index: 3;
}

.success-panel .secondary-btn {
    margin-top: 10px;
}

.notice {
    margin: 16px 0;
    border-radius: 10px;
    padding: 13px 15px;
    border: 1px solid var(--line);
    background: #fff;
}

.notice.success {
    border-color: #a5d6c1;
    background: #eefaf5;
    color: #0f5d3f;
}

.notice.error {
    border-color: #f3b4ae;
    background: #fff1f0;
    color: var(--red);
}

.notice.warn {
    border-color: #ffd99a;
    background: #fff8eb;
    color: #8a4b00;
}

.login-body,
.install-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 20px;
    background: radial-gradient(circle at top left, #e0efff, transparent 38%), var(--bg);
}

.login-card,
.install-shell {
    width: min(760px, 100%);
    padding: clamp(22px, 5vw, 38px);
}

.login-card { max-width: 430px; }

.brand-logo,
.login-card img,
.admin-sidebar img {
    width: 200px;
    height: auto;
}

.grid {
    display: grid;
    gap: 14px;
}

.grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact {
    max-width: 920px;
}

.admin-body {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    min-height: 100vh;
}

.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px;
    background: #0b1f37;
    color: #fff;
}

.admin-sidebar nav {
    display: grid;
    gap: 6px;
    margin-top: 28px;
}

.admin-sidebar a {
    color: #d7e7ff;
    border-radius: 8px;
    padding: 11px 12px;
    font-weight: 800;
}

.admin-sidebar a:hover {
    background: rgba(255, 255, 255, .1);
    text-decoration: none;
}

.admin-main {
    padding: clamp(18px, 3vw, 34px);
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.admin-header h1 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.7rem);
}

.panel {
    margin-bottom: 18px;
    padding: clamp(16px, 3vw, 24px);
}

.panel h2 {
    margin: 0 0 14px;
    font-size: 1.25rem;
}

.panel-heading,
.record-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stat-grid article {
    padding: 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.stat-grid strong {
    display: block;
    font-size: 2rem;
    color: var(--navy);
}

.stat-grid span { color: var(--muted); }

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.badge {
    display: inline-flex;
    border-radius: 999px;
    padding: 5px 9px;
    font-weight: 900;
    font-size: .82rem;
}

.badge.good { background: #e8f7f0; color: var(--green); }
.badge.warn { background: #fff3da; color: var(--amber); }
.badge.bad { background: #fff1f0; color: var(--red); }
.badge.neutral { background: #edf2f7; color: #344054; }

.question-list,
.answer-list {
    display: grid;
    gap: 12px;
}

.question-list article,
.answer-list article {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px;
    background: #fbfdff;
}

.question-list article {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 16px;
}

.question-list article span,
.answer-list article span {
    color: var(--muted);
}

.score-tile {
    display: grid;
    justify-items: end;
    gap: 8px;
}

.score-tile strong {
    font-size: 3rem;
    line-height: 1;
}

.copy-box {
    min-height: 250px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre-wrap;
}

@media (max-width: 850px) {
    .admin-body {
        display: block;
    }

    .admin-sidebar {
        position: static;
        height: auto;
    }

    .admin-sidebar nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat-grid,
    .grid.two {
        grid-template-columns: 1fr;
    }

    .admin-header,
    .panel-heading,
    .record-head {
        display: grid;
    }

    .score-tile {
        justify-items: start;
    }
}

@media (max-width: 560px) {
    .topbar img,
    .brand-logo,
    .login-card img,
    .admin-sidebar img {
        width: 165px;
    }

    .candidate-shell {
        width: min(100% - 20px, 900px);
        padding-top: 16px;
    }

    .hero-band,
    .job-summary,
    .success-panel {
        border-radius: 10px;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }
}
