:root {
    color-scheme: light;
    --paper: #f4f1eb;
    --card: #fffdf9;
    --ink: #161513;
    --muted: #66645f;
    --line: rgba(22, 21, 19, 0.16);
    --accent: #f0442f;
    --dark: #080b12;
    --page: min(900px, calc(100% - 40px));
    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --display: "Segoe UI", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: auto;
    background: var(--paper);
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

.legal-top {
    position: sticky;
    z-index: 10;
    top: 0;
    color: var(--ink);
    background: rgba(250, 246, 243, 0.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

.legal-top-inner {
    width: min(1180px, calc(100% - 40px));
    min-height: 76px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.legal-brand {
    display: grid;
    color: var(--ink);
    line-height: 1;
    text-decoration: none;
}

.legal-brand strong {
    font-family: var(--display);
    font-size: 1.8rem;
    font-weight: 400;
    letter-spacing: 0.03em;
}

.legal-brand span {
    margin-top: 4px;
    color: var(--accent);
    font-size: 0.52rem;
    font-weight: 800;
    letter-spacing: 0.32em;
    text-transform: uppercase;
}

.back-link {
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: none;
}

.back-link:hover,
.back-link:focus-visible {
    color: var(--accent);
}

.legal-page {
    width: var(--page);
    margin: auto;
    padding: clamp(60px, 9vw, 120px) 0 90px;
}

.legal-intro {
    margin-bottom: clamp(42px, 7vw, 78px);
}

.legal-kicker {
    margin: 0 0 14px;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.legal-intro h1 {
    max-width: 820px;
    margin: 0 0 24px;
    font-family: var(--display);
    font-size: clamp(3.4rem, 9vw, 7.8rem);
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: -0.045em;
    overflow-wrap: anywhere;
}

.legal-intro > p:last-child {
    max-width: 720px;
    margin: 0;
    color: var(--muted);
    font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.legal-content {
    padding: clamp(26px, 6vw, 64px);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 26px;
    box-shadow: 0 24px 70px rgba(30, 27, 22, 0.08);
}

.legal-content h2 {
    margin: 3rem 0 1rem;
    font-family: var(--display);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    line-height: 1;
    overflow-wrap: anywhere;
}

.legal-content h2:first-child {
    margin-top: 0;
}

.legal-content h3 {
    margin: 2rem 0 0.7rem;
    font-size: 1.15rem;
}

.legal-content p,
.legal-content ul,
.legal-content ol {
    margin: 0 0 1.2rem;
}

.legal-content ul,
.legal-content ol {
    padding-left: 1.3rem;
}

.legal-content li + li {
    margin-top: 0.55rem;
}

.legal-content a {
    color: #a72b1e;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.legal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 1.7rem 0;
}

.legal-button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    color: #fff !important;
    background: var(--accent);
    border: 2px solid var(--accent);
    border-radius: 999px;
    font: inherit;
    font-weight: 800 !important;
    text-decoration: none;
    cursor: pointer;
}

.legal-button:hover,
.legal-button:focus-visible {
    color: var(--ink) !important;
    background: transparent;
}

.legal-form {
    display: grid;
    gap: 20px;
}

.legal-form label,
.legal-form legend {
    font-weight: 750;
}

.legal-form label {
    display: grid;
    gap: 7px;
}

.legal-form input,
.legal-form select,
.legal-form textarea {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    color: var(--ink);
    background: #fff;
    border: 1px solid rgba(22, 21, 19, 0.35);
    border-radius: 10px;
    font: inherit;
}

.legal-form textarea {
    min-height: 120px;
    resize: vertical;
}

.legal-form input:focus-visible,
.legal-form select:focus-visible,
.legal-form textarea:focus-visible {
    outline: 3px solid rgba(240, 68, 47, 0.25);
    border-color: var(--accent);
}

.legal-form fieldset {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    border: 0;
}

.legal-form .radio-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 500;
}

.legal-form .radio-option input {
    width: 20px;
    min-height: 20px;
    margin-top: 3px;
}

.field-hint {
    color: var(--muted);
    font-size: 0.88rem;
}

.form-trap {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.submission-summary {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.status-success {
    background: #e6f2ea;
    border-color: #257743;
}

.status-error {
    background: #f9ded8;
    border-color: var(--accent);
}

.legal-note,
.legal-source,
.withdrawal-box {
    margin: 1.5rem 0;
    padding: 20px 22px;
    background: #f5eee9;
    border-left: 4px solid var(--accent);
    border-radius: 0 14px 14px 0;
}

.legal-source {
    background: #eef1f4;
    border-color: #303744;
}

.legal-status {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 20px;
    padding: 8px 12px;
    color: #7c251b;
    background: #f9ded8;
    border: 1px solid rgba(240, 68, 47, 0.28);
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
}

.legal-status::before {
    content: "";
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
}

.legal-footer {
    color: #b4bac5;
    background: var(--dark);
}

.legal-footer-inner {
    width: min(1180px, calc(100% - 40px));
    margin: auto;
    padding: 32px 0;
    display: flex;
    justify-content: space-between;
    gap: 22px;
}

.legal-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
}

.legal-footer a {
    text-decoration: none;
}

.legal-footer a:hover,
.legal-footer a:focus-visible {
    color: #fff;
}

@media (max-width: 620px) {
    :root {
        --page: calc(100% - 24px);
    }

    .legal-top-inner,
    .legal-footer-inner {
        width: calc(100% - 24px);
    }

    .legal-top-inner {
        min-height: 68px;
    }

    .legal-brand strong {
        font-size: 1.5rem;
    }

    .back-link {
        font-size: 0.78rem;
    }

    .legal-page {
        padding-top: 52px;
        padding-bottom: 60px;
    }

    .legal-intro h1 {
        font-size: clamp(2.15rem, 10.5vw, 3rem);
        line-height: 1;
        letter-spacing: -0.035em;
    }

    .legal-content h2 {
        font-size: clamp(1.4rem, 7vw, 1.9rem);
        line-height: 1.12;
    }

    .legal-content {
        border-radius: 20px;
    }

    .legal-footer-inner {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
