:root {
    --bg: #f4f5f7;
    --surface: #ffffff;
    --text: #1a1a1a;
    --muted: #5c6570;
    --border: #d8dde3;
    --primary: #1f4b7a;
    --primary-hover: #163859;
    --success-bg: #e8f7ef;
    --success-text: #0f6b3a;
    --error-bg: #fdecec;
    --error-text: #9b1c1c;
    --radius: 10px;
    --font: Georgia, "Times New Roman", "Segoe UI", system-ui, sans-serif;
    --font-ui: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-ui);
    background:
        radial-gradient(ellipse at top, #e8eef5 0%, transparent 55%),
        var(--bg);
    color: var(--text);
    line-height: 1.55;
}

.wrap {
    width: min(640px, calc(100% - 32px));
    margin: 0 auto;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--primary);
    color: #fff;
    padding: 8px 12px;
    z-index: 9999;
}
.skip-link:focus { left: 12px; }

.site-header {
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.9);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 56px;
}

.brand {
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: 0.02em;
}

.site-nav {
    display: flex;
    gap: 14px;
    font-size: 0.92rem;
}

.site-nav a,
.site-footer a,
.form__hint a,
.legal a {
    color: var(--primary);
    text-decoration: none;
}
.site-nav a:hover,
.site-footer a:hover,
.form__hint a:hover,
.legal a:hover {
    text-decoration: underline;
}

.page {
    margin: 40px 0 56px;
    padding: 28px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(20, 35, 55, 0.06);
}

.page h1 {
    margin: 0 0 12px;
    font-family: var(--font);
    font-size: clamp(1.6rem, 4vw, 2rem);
    font-weight: 700;
    line-height: 1.25;
}

.lead {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 1.02rem;
}

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 0.95rem;
}
.alert--success {
    background: var(--success-bg);
    color: var(--success-text);
}
.alert--error {
    background: var(--error-bg);
    color: var(--error-text);
}

.form__group {
    margin-bottom: 16px;
}

.form label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.92rem;
    font-weight: 600;
}

.optional {
    font-weight: 400;
    color: var(--muted);
}

.form input,
.form textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    color: var(--text);
    background: #fff;
}

.form input:focus,
.form textarea:focus {
    outline: 2px solid rgba(31, 75, 122, 0.35);
    border-color: var(--primary);
}

.form textarea {
    resize: vertical;
    min-height: 140px;
}

.form__hint {
    margin: 0 0 18px;
    font-size: 0.85rem;
    color: var(--muted);
}

.btn {
    display: inline-block;
    border: 0;
    border-radius: 8px;
    padding: 12px 18px;
    background: var(--primary);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.btn:hover { background: var(--primary-hover); }

.legal h2 {
    margin: 1.6rem 0 0.5rem;
    font-size: 1.05rem;
}
.legal p {
    margin: 0 0 0.75rem;
    color: #2b3138;
}
.legal-back {
    margin-top: 2rem !important;
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 20px 0 28px;
    color: var(--muted);
    font-size: 0.9rem;
}

.site-footer__inner {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.site-footer p { margin: 0; }

@media (max-width: 520px) {
    .page { padding: 22px 16px; margin-top: 24px; }
    .site-header__inner { min-height: 52px; }
}
