:root {
    --bg: #f7f7f8;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --blue: #4f7cff;
    --blue-dark: #315fec;
    --danger: #e11d48;
}

* {
    box-sizing: border-box;
}

body {
    position: relative;
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, "Helvetica Neue", sans-serif;
    letter-spacing: 0;
    overflow-x: hidden;
}

.heritage-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    opacity: .72;
    pointer-events: none;
}

.russia-map-bg {
    position: fixed;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

/* Карта крупнее в покое (вместо анимированного scale), движение — только translate:
   слой растеризуется один раз и дальше двигается на GPU без перерисовок */
.russia-map-bg__stage {
    position: absolute;
    left: 50%;
    top: 52%;
    width: min(235vw, 2800px);
    aspect-ratio: 16 / 9;
    opacity: .92;
    transform: translate(-39%, -49%);
    will-change: transform;
    animation: russiaMapDolly 76s ease-in-out infinite;
}

.russia-map-bg__map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.russia-map-bg__pin {
    position: absolute;
    width: 8px;
    height: 8px;
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius: 50%;
    background: rgba(16, 35, 63, .22);
    animation: mapPinPulse 3.8s ease-in-out infinite;
}

.russia-map-bg__link {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, rgba(16, 35, 63, 0), rgba(16, 35, 63, .34), rgba(16, 35, 63, .08));
    opacity: 0;
    transform-origin: left center;
    box-shadow: 0 0 14px rgba(16, 35, 63, .1);
    animation: mapLinkBuild 7.6s ease-in-out infinite;
}

.russia-map-bg__pin::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 20px;
    border: 1px solid rgba(16, 35, 63, .13);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.russia-map-bg__pin--west {
    left: 15%;
    top: 46%;
}

.russia-map-bg__pin--moscow {
    left: 18%;
    top: 47%;
    animation-delay: .25s;
}

.russia-map-bg__pin--northwest {
    left: 14%;
    top: 40%;
    animation-delay: .55s;
}

.russia-map-bg__pin--volga {
    left: 23%;
    top: 50%;
    animation-delay: 1.05s;
}

.russia-map-bg__pin--south {
    left: 17%;
    top: 56%;
    animation-delay: 1.35s;
}

.russia-map-bg__pin--ural {
    left: 49%;
    top: 49%;
    animation-delay: .8s;
}

.russia-map-bg__pin--siberia {
    left: 63%;
    top: 52%;
    animation-delay: 1.6s;
}

.russia-map-bg__pin--east {
    left: 82%;
    top: 50%;
    animation-delay: 2.3s;
}

.russia-map-bg__link--central-1 {
    --line-angle: 32deg;
    left: 14%;
    top: 40%;
    width: 9.5%;
    transform: rotate(var(--line-angle)) scaleX(0);
    animation-delay: .2s;
}

.russia-map-bg__link--central-2 {
    --line-angle: 18deg;
    left: 17.5%;
    top: 47%;
    width: 10.8%;
    transform: rotate(var(--line-angle)) scaleX(0);
    animation-delay: 1.1s;
}

.russia-map-bg__link--central-3 {
    --line-angle: -42deg;
    left: 17%;
    top: 56%;
    width: 7.2%;
    transform: rotate(var(--line-angle)) scaleX(0);
    animation-delay: 2s;
}

.russia-map-bg__link--east-1 {
    --line-angle: 4deg;
    left: 23%;
    top: 50%;
    width: 31%;
    transform: rotate(var(--line-angle)) scaleX(0);
    animation-delay: 3.2s;
}

.page-shell {
    position: relative;
    z-index: 3;
    width: min(100%, 920px);
    margin: 0 auto;
    padding: 28px 18px 60px;
}

@keyframes russiaMapDolly {
    0%, 100% {
        transform: translate(-39%, -49%);
    }
    50% {
        transform: translate(-61%, -52%);
    }
}

@keyframes mapPinPulse {
    0%, 100% {
        transform: scale(.9);
        opacity: .75;
    }
    45% {
        transform: scale(1.18);
        opacity: 1;
    }
}

@keyframes mapLinkBuild {
    0%, 15% {
        opacity: 0;
        transform: rotate(var(--line-angle, 0deg)) scaleX(0);
    }
    34% {
        opacity: .82;
        transform: rotate(var(--line-angle, 0deg)) scaleX(1);
    }
    64% {
        opacity: .32;
        transform: rotate(var(--line-angle, 0deg)) scaleX(1);
    }
    82%, 100% {
        opacity: 0;
        transform: rotate(var(--line-angle, 0deg)) scaleX(.18);
    }
}

@media (prefers-reduced-motion: reduce) {
    .russia-map-bg__stage,
    .russia-map-bg__pin,
    .russia-map-bg__link {
        animation: none;
    }

    .russia-map-bg__stage {
        transform: translate(-39%, -49%);
        will-change: auto;
    }
}

/* На мобильных карту не двигаем: статичный кадр с Москвой по центру экрана
   (пин Москвы стоит на 18% ширины сцены, отсюда translateX(-18%)) */
@media (max-width: 640px) {
    .russia-map-bg__stage {
        animation: none;
        will-change: auto;
        width: 300vw;
        transform: translate(-18%, -50%);
    }
}

.survey-header {
    text-align: center;
    margin-bottom: 28px;
}

.design-switch {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0 auto 22px;
}

.design-switch a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .72);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.design-switch a.is-active {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
}

.survey-header__kicker {
    margin: 0 0 8px;
    color: var(--blue-dark);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
}

.survey-header h1 {
    margin: 0;
    font-size: clamp(30px, 5vw, 44px);
    line-height: 1.18;
    font-weight: 800;
}

.progress {
    height: 6px;
    overflow: hidden;
    margin: 0 auto 18px;
    border-radius: 999px;
    background: #e8edf8;
}

.progress__bar {
    width: 25%;
    height: 100%;
    border-radius: inherit;
    background: var(--blue);
    transition: width .2s ease;
}

.survey-card {
    width: min(100%, 760px);
    margin: 0 auto;
    padding: clamp(28px, 6vw, 64px);
    border: 1px solid #eceef3;
    border-radius: 24px;
    background: var(--card);
    box-shadow: 0 2px 10px rgba(15, 23, 42, .06), 0 18px 55px rgba(15, 23, 42, .08);
}

.step {
    display: none;
}

.step.is-active {
    display: block;
}

.field {
    margin-bottom: 24px;
}

label,
legend {
    display: block;
    margin: 0 0 9px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
}

label span,
legend span {
    color: var(--danger);
}

input[type="text"],
input[type="email"],
textarea {
    width: min(100%, 430px);
    min-height: 40px;
    padding: 10px 13px;
    border: 1px solid #d9dde5;
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

textarea {
    width: min(100%, 560px);
    min-height: 120px;
    resize: vertical;
}

input:focus,
textarea:focus {
    border-color: var(--blue);
    outline: 2px solid rgba(79, 124, 255, .16);
}

.hint {
    max-width: 620px;
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.hint a {
    color: var(--blue-dark);
}

.consent,
.option-list label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 14px 16px;
    border: 1px solid #d9dde5;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.consent:focus-within,
.option-list label:focus-within {
    border-color: var(--blue);
    outline: 2px solid rgba(79, 124, 255, .16);
}

.consent input,
.option-list input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: var(--blue);
}

.hidden-after-consent {
    display: none;
}

.hidden-after-consent.is-visible {
    display: block;
}

.choice-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.choice-buttons label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    margin: 0;
    padding: 10px 16px;
    border: 1px solid #d9dde5;
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.choice-buttons input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.choice-buttons label:hover,
.choice-buttons label:focus-within {
    border-color: var(--blue);
}

.choice-buttons label.is-selected {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
}

.choice-buttons label.is-selected span {
    color: #fff;
}

.field--nested {
    display: none;
    margin: 14px 0 0;
}

.field--nested.is-visible {
    display: block;
}

fieldset {
    min-width: 0;
    padding: 0;
    border: 0;
}

.option-list {
    display: grid;
    gap: 6px;
}

.option-list.is-invalid label {
    border-color: rgba(225, 29, 72, .55);
}

.upload-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 20px;
}

.geo-picker {
    width: min(100%, 560px);
    margin-top: 12px;
}

.geo-picker__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-bottom: 10px;
}

.geo-picker__map {
    height: 260px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #eef2ff;
}

input[type="file"] {
    width: min(100%, 260px);
}

#fileHint {
    color: var(--muted);
    font-size: 14px;
}

.file-preview {
    display: grid;
    gap: 6px;
    width: min(100%, 560px);
    margin-top: 10px;
}

.file-preview:empty {
    display: none;
}

.file-preview__item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 10px;
    min-height: 34px;
    padding: 6px 8px 6px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .68);
}

.file-preview__name {
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-preview__size {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.file-preview__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid rgba(159, 39, 53, .25);
    border-radius: 8px;
    background: rgba(255, 255, 255, .8);
    color: var(--danger);
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.file-preview__remove:hover {
    border-color: rgba(159, 39, 53, .45);
    background: rgba(159, 39, 53, .08);
}

.form-error {
    min-height: 22px;
    margin: 6px 0 18px;
    color: var(--danger);
    font-size: 14px;
    font-weight: 700;
}

.nav {
    display: flex;
    gap: 14px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 18px;
    border: 0;
    border-radius: 8px;
    background: var(--blue);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s ease, transform .18s ease;
}

.button:hover {
    background: var(--blue-dark);
    transform: translateY(-1px);
}

.button:disabled {
    cursor: wait;
    opacity: .7;
    transform: none;
}

.button--ghost {
    background: #eef3ff;
    color: var(--blue-dark);
}

.button--ghost:hover {
    background: #dfe8ff;
}

.success {
    text-align: center;
}

.success__mark {
    width: 70px;
    height: 70px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: #16a34a;
    color: #fff;
    font-size: 42px;
    line-height: 70px;
    font-weight: 800;
}

.success h2 {
    margin: 0 0 12px;
    font-size: 30px;
}

.success p {
    margin: 0 0 24px;
    color: var(--muted);
}

@media (max-width: 640px) {
    /* Боковые отступы шире, чтобы по краям формы читался силуэт карты */
    .page-shell {
        padding: 22px 24px 38px;
    }

    .survey-card {
        padding: 26px 16px;
        border-radius: 18px;
    }

    .nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .button {
        width: 100%;
    }
}

/* Design 1: archive map */
body.design-1 {
    --bg: #f1eadc;
    --card: #fffaf0;
    --text: #1f2a2e;
    --muted: #6d6254;
    --line: #dfd0b8;
    --blue: #2f5f7d;
    --blue-dark: #244b63;
    background:
        linear-gradient(rgba(47, 95, 125, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(47, 95, 125, .035) 1px, transparent 1px),
        var(--bg);
    background-size: 32px 32px;
}

.design-1 .survey-header h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 700;
}

.design-1 .survey-card,
.design-1 .success {
    border-color: #d9c6a7;
    box-shadow: 0 18px 50px rgba(77, 58, 32, .14);
}

.design-1 .survey-card::before {
    content: "";
    display: block;
    height: 4px;
    margin: calc(clamp(28px, 6vw, 64px) * -1) calc(clamp(28px, 6vw, 64px) * -1) 30px;
    background: linear-gradient(90deg, #2f5f7d, #b75b3a);
}

.design-1 .button {
    background: #2f5f7d;
}

.design-1 .button--ghost {
    background: #efe3cf;
    color: #244b63;
}

/* Design 3: museum registry */
body.design-3 {
    --bg: #f7f8fb;
    --card: #ffffff;
    --text: #101827;
    --muted: #667085;
    --line: #d8dde8;
    --blue: #9f2735;
    --blue-dark: #10233f;
    background:
        linear-gradient(90deg, rgba(16, 35, 63, .035) 1px, transparent 1px),
        linear-gradient(rgba(16, 35, 63, .035) 1px, transparent 1px),
        radial-gradient(circle at 50% 0%, rgba(159, 39, 53, .055), transparent 34%),
        var(--bg);
    background-size: 42px 42px, 42px 42px, 100% 100%, auto;
}

.design-3 .survey-header {
    text-align: left;
    width: min(100%, 760px);
    margin-left: auto;
    margin-right: auto;
}

.design-3 .survey-header__kicker {
    color: #9f2735;
}

.design-3 .survey-header h1 {
    font-family: Georgia, "Times New Roman", serif;
    color: #10233f;
    font-size: clamp(30px, 4.6vw, 42px);
}

.design-3 .survey-card,
.design-3 .success {
    border-top: 6px solid #10233f;
    border-radius: 8px;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 34px rgba(16, 35, 63, .1);
}

.design-3 input[type="text"],
.design-3 input[type="email"],
.design-3 textarea,
.design-3 .consent,
.design-3 .option-list label,
.design-3 .choice-buttons label,
.design-3 .geo-picker__map {
    border-radius: 4px;
}

.design-3 .button {
    border-radius: 4px;
    background: #10233f;
}

.design-3 .button--ghost {
    background: #f3e7e9;
    color: #9f2735;
}

/* Design 4: city navigation */
body.design-4 {
    --bg: #f6f8fb;
    --card: #ffffff;
    --text: #0b1220;
    --muted: #64748b;
    --line: #e2e8f0;
    --blue: #0b74ff;
    --blue-dark: #0559c9;
}

.design-4 .page-shell {
    width: min(100%, 1040px);
}

.design-4 .survey-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: min(100%, 760px);
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

.design-4 .survey-header h1 {
    font-size: clamp(34px, 5.3vw, 56px);
    line-height: 1.02;
}

.design-4 .survey-card,
.design-4 .success {
    border-color: #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 18px 46px rgba(15, 23, 42, .08);
}

.design-4 .progress {
    width: min(100%, 760px);
}

.design-4 .button {
    background: #0b74ff;
}

.design-4 .button--ghost {
    background: #eaf3ff;
    color: #0559c9;
}

.design-4 .choice-buttons label.is-selected {
    background: #0b74ff;
}
