:root {
    --bg: #f4efe8;
    --surface: rgba(255, 252, 247, 0.94);
    --surface-strong: #f3e8d3;
    --text: #191816;
    --muted: #5f554a;
    --accent: #9f3a1d;
    --accent-dark: #742711;
    --accent-soft: rgba(159, 58, 29, 0.08);
    --ink-soft: #efe4d4;
    --border: #dbcbb5;
    --success: #1e6e4b;
    --danger: #9d2f24;
    --shadow: 0 20px 60px rgba(41, 29, 16, 0.12);
    --radius: 24px;
    --radius-sm: 16px;
    --max: 1180px;
    --font-heading: "Georgia", "Times New Roman", serif;
    --font-body: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(159, 58, 29, 0.18), transparent 25%),
        radial-gradient(circle at top right, rgba(57, 88, 72, 0.08), transparent 22%),
        linear-gradient(180deg, #f8f2ea 0%, var(--bg) 100%);
}

a {
    color: inherit;
}

.page,
.admin-shell {
    max-width: var(--max);
    margin: 0 auto;
    padding: 28px 18px 64px;
}

.hero,
.panel,
.stats-grid > article,
.table-card,
.login-card {
    background: var(--surface);
    border: 1px solid rgba(216, 200, 176, 0.92);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.hero {
    position: relative;
    overflow: hidden;
    padding: 28px;
    display: grid;
    gap: 24px;
}

.hero::before {
    content: "";
    position: absolute;
    inset: auto -80px -100px auto;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(159, 58, 29, 0.12), transparent 70%);
    pointer-events: none;
}

.hero h1,
.panel h2,
.table-card h2,
.login-card h1,
.statement-card h3 {
    margin: 0;
    font-family: var(--font-heading);
    line-height: 1.05;
}

.hero h1 {
    font-size: clamp(2.35rem, 4vw, 4.3rem);
    max-width: 10ch;
    letter-spacing: -0.03em;
}

.hero-topline,
.button-row,
.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.hero-grid,
.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 24px;
}

.hero-actions {
    margin: 18px 0 8px;
}

.eyebrow,
.mini-stat {
    display: inline-flex;
    align-items: center;
    padding: 10px 15px;
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--accent-dark);
    font-size: 14px;
    font-weight: 700;
    border: 1px solid rgba(159, 58, 29, 0.12);
}

.mini-stat {
    background: rgba(29, 111, 79, 0.1);
    color: var(--success);
}

.lead,
.panel p,
.panel li,
.table-note,
.login-card p {
    color: var(--muted);
    line-height: 1.7;
}

.lead {
    max-width: 60ch;
    font-size: 1.08rem;
}

.hero-points,
.demand-list {
    margin: 18px 0 0;
    padding-left: 20px;
    line-height: 1.7;
}

.hero-points li::marker,
.demand-list li::marker {
    color: var(--accent);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.stats-grid article {
    padding: 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(247, 239, 226, 0.9));
}

.stats-grid strong {
    display: block;
    font-size: 34px;
    color: var(--accent);
    margin-top: 8px;
}

.panel,
.table-card,
.login-card {
    padding: 26px;
}

.inset-panel,
.statement-card,
.privacy-box,
.trust-box,
.legal-links-card {
    background: linear-gradient(180deg, rgba(255, 247, 233, 0.96), rgba(247, 238, 221, 0.9));
    border: 1px solid rgba(216, 200, 176, 0.85);
    border-radius: var(--radius-sm);
}

.trust-box,
.privacy-box,
.statement-card,
.legal-links-card {
    margin-top: 18px;
    padding: 16px;
}

.legal-links-card a,
.site-footer a,
.legal-page a {
    color: var(--accent-dark);
    font-weight: 700;
}

.form-note {
    margin: 10px 0 18px;
}

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

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

.field {
    display: grid;
    gap: 8px;
}

.field.full {
    grid-column: 1 / -1;
}

label {
    font-weight: 700;
}

input,
select {
    width: 100%;
    min-height: 50px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
    color: var(--text);
    font: inherit;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}

input:focus,
select:focus {
    outline: 2px solid rgba(165, 62, 34, 0.18);
    border-color: var(--accent);
}

.checkbox {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    color: var(--muted);
    line-height: 1.6;
}

.checkbox input {
    width: auto;
    min-height: auto;
    margin-top: 4px;
}

button,
.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    min-height: 48px;
    padding: 12px 22px;
    background: linear-gradient(180deg, #b44925, var(--accent));
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

button:hover,
.button-link:hover {
    background: linear-gradient(180deg, #8d3117, var(--accent-dark));
    transform: translateY(-1px);
}

.button-link.secondary {
    background: rgba(255,255,255,0.88);
    color: var(--accent-dark);
    border: 1px solid var(--border);
}

.button-link.secondary:hover {
    background: #f7f1e8;
}

.button-link.ghost {
    background: transparent;
    color: var(--accent-dark);
    border: 1px dashed var(--border);
}

.button-link.ghost:hover {
    background: rgba(255, 255, 255, 0.6);
}

.alert {
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    line-height: 1.6;
}

.alert-danger {
    background: #fde7e3;
    color: var(--danger);
}

.alert-success {
    background: #e2f3eb;
    color: var(--success);
}

.city-list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.city-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 0 0 10px;
    border-bottom: 1px dashed var(--border);
}

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

.admin-filters {
    margin: 24px 0;
}

.filter-actions {
    align-items: end;
}

.admin-grid {
    grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
}

.wide-card {
    min-width: 0;
}

.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.4);
}

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

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

th {
    color: var(--muted);
    font-size: 14px;
    background: rgba(243, 232, 211, 0.55);
}

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(460px, 100%);
    background:
        linear-gradient(180deg, rgba(255,252,247,0.98), rgba(250,244,235,0.94));
}

.site-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    justify-content: center;
    padding: 22px 8px 0;
    color: var(--muted);
}

.legal-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 28px 18px 64px;
}

.legal-page .panel {
    padding: 28px;
}

.legal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 14px;
}

.legal-section + .legal-section {
    margin-top: 22px;
}

.legal-section h2 {
    margin-bottom: 10px;
}

.legal-section ul {
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
    line-height: 1.7;
}

.document-shell {
    max-width: 980px;
    margin: 0 auto;
    padding: 24px 18px 64px;
}

.document-paper {
    position: relative;
    width: min(100%, 794px);
    min-height: 1123px;
    margin: 0 auto;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.995), rgba(252,248,242,0.985));
    border: 1px solid rgba(173, 160, 141, 0.78);
    border-radius: 12px;
    box-shadow:
        0 28px 80px rgba(41, 29, 16, 0.12),
        0 3px 10px rgba(41, 29, 16, 0.05);
    padding: 72px 74px 60px;
}

.document-paper::before {
    content: "";
    position: absolute;
    inset: 28px;
    border: 1px solid rgba(191, 180, 164, 0.52);
    border-radius: 4px;
    pointer-events: none;
}

.document-watermark {
    position: absolute;
    top: 220px;
    left: 50%;
    font-family: var(--font-heading);
    font-size: 96px;
    color: rgba(116, 39, 17, 0.045);
    transform: translateX(-50%) rotate(-18deg);
    pointer-events: none;
    user-select: none;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.document-head {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(180, 166, 145, 0.9);
    margin-bottom: 24px;
}

.document-kicker {
    color: #5d5346;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.document-head h1 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: clamp(2.1rem, 3vw, 3.15rem);
    line-height: 1.12;
    letter-spacing: -0.02em;
}

.document-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    color: var(--muted);
    font-size: 13px;
}

.document-address {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
    margin-bottom: 28px;
    padding: 18px 20px;
    background: rgba(250, 246, 240, 0.72);
    border: 1px solid rgba(193, 181, 162, 0.82);
    border-radius: 8px;
}

.document-address-row {
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 12px;
    align-items: start;
}

.document-address-row strong {
    color: var(--accent-dark);
}

.document-section {
    position: relative;
    z-index: 1;
}

.document-section + .document-section {
    margin-top: 26px;
}

.document-section h2 {
    margin: 0 0 10px;
    font-family: var(--font-heading);
    font-size: 1.45rem;
}

.document-section p,
.document-section li {
    color: var(--muted);
    line-height: 1.9;
    font-size: 16px;
    text-align: justify;
}

.document-section ul {
    margin: 0;
    padding-left: 24px;
}

.document-signature-box {
    position: relative;
    z-index: 1;
    margin-top: 30px;
    padding: 22px;
    background: rgba(249, 244, 235, 0.88);
    border: 1px solid rgba(170, 152, 126, 0.55);
    border-radius: 8px;
}

.document-signature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.document-signature-card {
    min-height: 142px;
    padding: 18px;
    background: rgba(255,255,255,0.66);
    border: 1px dashed rgba(138, 119, 93, 0.34);
    border-radius: 8px;
}

.document-signature-card strong {
    display: block;
    margin-bottom: 10px;
}

.document-line {
    margin-top: 48px;
    border-top: 1px solid rgba(95, 85, 74, 0.5);
    padding-top: 8px;
    color: var(--muted);
    font-size: 14px;
}

.document-attachments {
    position: relative;
    z-index: 1;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(196, 176, 146, 0.7);
    color: var(--muted);
}

.document-actions {
    position: relative;
    z-index: 1;
    margin-top: 30px;
    justify-content: space-between;
}

@media print {
    @page {
        size: A4;
        margin: 12mm;
    }

    body {
        background: #fff;
    }

    .document-shell {
        max-width: none;
        padding: 0;
    }

    .document-paper {
        box-shadow: none;
        border: 0;
        border-radius: 0;
        width: 100%;
        min-height: auto;
        padding: 0;
    }

    .document-paper::before,
    .document-actions,
    .document-watermark {
        display: none;
    }
}

@media (max-width: 920px) {
    .hero-grid,
    .content-grid,
    .stats-grid,
    .admin-grid,
    .form-grid,
    .filter-grid {
        grid-template-columns: 1fr;
    }

    .page,
    .admin-shell {
        padding-inline: 14px;
    }

    .hero,
    .panel,
    .table-card,
    .login-card {
        padding: 20px;
    }

    .stats-grid strong {
        font-size: 28px;
    }

    .document-signature-grid {
        grid-template-columns: 1fr;
    }

    .document-paper {
        min-height: auto;
        padding: 36px 24px 34px;
    }

    .document-paper::before {
        inset: 14px;
    }

    .document-address-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

@media (max-width: 640px) {
    body {
        background:
            radial-gradient(circle at top left, rgba(165, 62, 34, 0.14), transparent 35%),
            linear-gradient(180deg, #f8f2e8 0%, var(--bg) 100%);
    }

    .hero h1 {
        font-size: 2.3rem;
        max-width: none;
    }

    .lead {
        font-size: 1rem;
    }

    button,
    .button-link,
    input,
    select {
        font-size: 16px;
    }

    .checkbox {
        align-items: flex-start;
    }
}
