:root {
    --bg: #f4f6f8;
    --panel: #ffffff;
    --ink: #20242a;
    --muted: #626b76;
    --line: #d7dde5;
    --accent: #0f6b5c;
    --accent-dark: #0a4e43;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
}

.app-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 32px auto;
}

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

.eyebrow {
    margin: 0 0 4px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
}

.page-title h1 {
    font-size: 28px;
}

.secondary-action {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

.form-grid {
    display: grid;
    gap: 16px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

.panel h2 {
    margin-bottom: 16px;
    font-size: 18px;
}

.grid {
    display: grid;
    gap: 14px;
    margin-bottom: 14px;
}

.grid:last-child {
    margin-bottom: 0;
}

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

.grid.three {
    grid-template-columns: 2fr 1fr 1fr;
}

.grid.four {
    grid-template-columns: 2fr 1fr 1fr 1fr;
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

input {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 10px;
    color: var(--ink);
    font: 15px Arial, Helvetica, sans-serif;
}

input:focus {
    border-color: var(--accent);
    outline: 3px solid rgba(15, 107, 92, 0.14);
}

.actions {
    display: flex;
    justify-content: flex-end;
    padding-bottom: 24px;
}

button {
    min-height: 42px;
    border: 0;
    border-radius: 7px;
    background: var(--accent);
    color: #ffffff;
    padding: 0 18px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

button:hover {
    background: var(--accent-dark);
}

button.muted {
    background: #59636f;
}

.document-body {
    background: #dfe4ea;
}

.print-toolbar {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    z-index: 10;
}

.document-page {
    width: 210mm;
    min-height: 297mm;
    margin: 18px auto;
    padding: 18mm 18mm 16mm;
    background: #ffffff;
    color: #111111;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
    font-family: "Times New Roman", Times, serif;
    font-size: 12pt;
    line-height: 1.36;
}

.doc-header {
    text-align: center;
}

.state-logo {
    display: block;
    width: 30mm;
    height: auto;
    margin: 0 auto 4mm;
}

.doc-header p {
    margin: 0 0 12px;
    font-weight: 700;
}

.doc-header h1 {
    margin-bottom: 18px;
    font-size: 13pt;
}

.document-page h2 {
    margin: 12px 0 6px;
    font-size: 11pt;
}

.document-page p {
    margin: 8px 0;
    text-align: justify;
}

.reference {
    font-weight: 700;
}

.doc-table {
    width: 100%;
    margin: 6px 0 12px;
    border-collapse: collapse;
    table-layout: fixed;
}

.doc-table td {
    min-height: 32px;
    border: 1px solid #000000;
    padding: 4px 6px 7px;
    vertical-align: top;
}

.doc-table span {
    display: block;
    margin-bottom: 3px;
    font-size: 8.5pt;
    font-weight: 700;
}

.signature-block {
    margin-top: 30px;
    text-align: center;
}

.signature-block p {
    text-align: center;
}

.signature-line {
    width: 95mm;
    margin: 34px auto 6px;
    border-top: 1px solid #000000;
}

@media (max-width: 780px) {
    .page-title {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .document-page {
        width: calc(100% - 20px);
        min-height: auto;
        padding: 18px;
    }
}

@media print {
    @page {
        size: A4;
        margin: 0;
    }

    body,
    .document-body {
        background: #ffffff;
    }

    .print-toolbar {
        display: none;
    }

    .document-page {
        width: 210mm;
        min-height: 297mm;
        margin: 0;
        padding: 18mm 18mm 16mm;
        box-shadow: none;
    }
}
