:root {
    --accent: #e69138;
    --accent-dark: #aa5d1c;
    --ink: #25211d;
    --muted: #73695e;
    --line: #ded4c6;
    --paper: #fffdf9;
    --wash: #f6f1e9;
    --error: #9f1f24;
    --success: #256b44;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f4f0ea;
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.45;
}

.site-header {
    background: var(--accent);
    color: #fff;
    border-bottom: 8px solid #f8d7ac;
}

.topbar {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    min-height: 160px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo {
    width: 94px;
    height: 94px;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
    padding: 8px;
}

.kicker {
    margin: 0 0 4px;
    font-weight: 700;
    letter-spacing: 0;
}

h1 {
    margin: 0;
    font-size: 2.4rem;
    line-height: 1.1;
}

.subtitle {
    max-width: 720px;
    margin: 12px 0 0;
    font-size: 1.05rem;
}

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

.application-form,
.notice {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: clamp(18px, 3vw, 34px);
    box-shadow: 0 16px 35px rgba(60, 44, 22, 0.08);
}

.notice {
    margin-bottom: 22px;
}

.notice h2,
.hint h2 {
    margin: 0 0 8px;
    font-size: 1.1rem;
}

.notice p,
.hint p {
    margin: 8px 0;
}

.success {
    border-left: 6px solid var(--success);
}

.error {
    border-left: 6px solid var(--error);
}

.pdf-preview {
    width: 100%;
    height: 540px;
    margin-top: 18px;
    border: 1px solid var(--line);
    border-radius: 6px;
}

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

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

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

.field {
    display: grid;
    gap: 7px;
    margin-bottom: 18px;
    font-weight: 700;
}

.field span span {
    color: var(--accent-dark);
}

input,
textarea {
    width: 100%;
    border: 1px solid #cfc4b4;
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    padding: 12px 13px;
    outline: none;
}

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

input:focus,
textarea:focus,
canvas:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(230, 145, 56, 0.22);
}

hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 18px 0 24px;
}

.signature-block {
    margin: 8px 0 22px;
}

.signature-block label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
}

canvas {
    width: 100%;
    height: 220px;
    display: block;
    border: 1px solid #cfc4b4;
    border-radius: 6px;
    background: #fff;
    touch-action: none;
}

.signature-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.hint {
    background: var(--wash);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    margin: 20px 0;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 0;
    border-radius: 6px;
    padding: 0 18px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

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

.secondary {
    background: #ece3d7;
    color: var(--ink);
}

.secondary:hover {
    background: #ded1bf;
}

.submit {
    width: 100%;
    font-size: 1.05rem;
}

.hidden-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
}

@media (max-width: 820px) {
    .topbar {
        min-height: 140px;
        align-items: flex-start;
        flex-direction: column;
        padding: 22px 0;
        gap: 12px;
    }

    h1 {
        font-size: 2rem;
    }

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

    .logo {
        width: 76px;
        height: 76px;
    }
}
