:root {
    --ink: #102033;
    --muted: #607080;
    --line: #d9e4e2;
    --panel: #ffffff;
    --bg: #f3f7f7;
    --brand: #146b64;
    --brand-dark: #0f3b38;
    --soft: #e7f3f1;
    --danger: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(20, 107, 100, .12), rgba(16, 32, 51, .03)),
        var(--bg);
}

.login-card {
    width: min(440px, 100%);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 32px;
    box-shadow: 0 24px 70px rgba(16, 32, 51, .08);
}

.brand-mark {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--brand-dark);
    color: white;
    font-weight: 800;
    letter-spacing: .04em;
}

.login-card h1 {
    margin: 18px 0 8px;
    font-size: 30px;
}

.login-card p {
    margin: 0 0 22px;
    color: var(--muted);
}

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

label,
fieldset {
    display: grid;
    gap: 8px;
    font-weight: 700;
    color: #263747;
}

fieldset {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px;
}

legend {
    padding: 0 6px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #cbd8d6;
    border-radius: 10px;
    padding: 11px 12px;
    background: white;
    color: var(--ink);
}

textarea {
    min-height: 116px;
    resize: vertical;
}

button,
.primary,
.download {
    border: 0;
    border-radius: 10px;
    min-height: 44px;
    padding: 0 16px;
    background: var(--brand);
    color: white;
    font-weight: 800;
    cursor: pointer;
}

.topbar {
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    background: var(--brand-dark);
    color: white;
}

.topbar div,
.topbar nav {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar strong {
    font-size: 22px;
}

.topbar span {
    opacity: .88;
}

.topbar a {
    padding: 9px 13px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 10px;
}

.workspace {
    display: grid;
    grid-template-columns: 520px 1fr;
    gap: 18px;
    padding: 18px;
    min-height: calc(100vh - 68px);
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px;
    min-width: 0;
}

.form-panel {
    align-self: start;
}

.section-title {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
}

.section-title > span {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--soft);
    color: var(--brand);
    font-weight: 900;
}

.section-title h1,
.section-title h2 {
    margin: 0;
    font-size: 26px;
}

.section-title p {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.assessment-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.wide {
    grid-column: 1 / -1;
}

.checks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.checks label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fbfb;
    font-weight: 600;
}

.checks input {
    width: auto;
}

.alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid #f2b8b5;
    border-radius: 10px;
    background: #fff3f2;
    color: var(--danger);
    font-weight: 700;
}

.empty-state {
    min-height: 420px;
    display: grid;
    place-content: center;
    text-align: center;
    color: var(--muted);
}

.empty-state h3 {
    margin: 0 0 8px;
    color: var(--ink);
}

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

.job-header h3 {
    margin: 8px 0 0;
    font-size: 24px;
}

.badge {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--soft);
    color: var(--brand);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.download {
    display: inline-flex;
    align-items: center;
}

.draft-section {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
    margin-top: 14px;
}

.draft-section h4 {
    margin: 0 0 8px;
    font-size: 18px;
}

.draft-section p {
    color: var(--muted);
}

.draft-section pre {
    max-height: 320px;
    overflow: auto;
    white-space: pre-wrap;
    padding: 14px;
    border-radius: 10px;
    background: #f6f8fa;
    color: #243647;
}

.draft-section small {
    color: var(--muted);
}

@media (max-width: 1050px) {
    .workspace {
        grid-template-columns: 1fr;
    }

    .assessment-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .topbar {
        height: auto;
        align-items: flex-start;
        flex-direction: column;
        padding: 18px;
    }

    .workspace {
        padding: 10px;
    }

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