:root {
    --bg: #ffffff;
    --surface: #f3f4fa; /* лилово-серая подложка секций */
    --surface-2: #ebeffc; /* акцентная светлая подложка */
    --line: #d7daeb; /* границы */
    --ink: #322d2d; /* основной текст */
    --muted: #5f5c66; /* вторичный текст (контраст ≥4.5:1 на белом) */
    --accent: #1C32A3;
    --accent-weak: #8f9fff1c;
    --hq: #f10d0d;
    --rep: #e0850b;
    --school: #0288d1;
    --location: #0f9e92;
    --field-bg: #ffffff;
    --radius: 14px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
    box-sizing: border-box;
}

.anketa {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 20px 72px;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

.anketa__title {
    margin: 0 0 8px;
    font-size: clamp(26px, 5vw, 34px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    text-wrap: balance;
}

.anketa__lead {
    margin: 0 0 32px;
    max-width: 60ch;
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--muted);
    text-wrap: pretty;
}

fieldset {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0 20px 24px;
    margin: 0 0 18px;
    background: var(--bg);
}

legend {
    padding: 0 10px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--accent);
}

label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    margin: 16px 0 6px;
    color: var(--ink);
}

label .req {
    color: var(--hq);
    margin-left: 2px;
}

.hint {
    display: block;
    font-weight: 400;
    color: var(--muted);
    font-size: 12.5px;
    margin-top: 2px;
}

input[type=text], input[type=tel], input[type=email], input[type=url], textarea, select {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
    font-size: 15px;
    color: var(--ink);
    background: var(--field-bg);
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}

::placeholder {
    color: #9a97a3;
}

textarea {
    min-height: 78px;
    resize: vertical;
    line-height: 1.55;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-weak);
}

.types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 6px;
}

.type-card {
    position: relative;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    background: var(--bg);
    transition: border-color .18s var(--ease), background .18s var(--ease), transform .06s var(--ease);
}

.type-card:hover {
    border-color: #b9bcd4;
}

.type-card:active {
    transform: translateY(1px);
}

.type-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.type-card.sel {
    border-color: var(--accent);
    background: var(--accent-weak);
}

.type-card b {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 15px;
    font-weight: 600;
}

.type-card .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: none;
}

.type-card span {
    display: block;
    margin-top: 5px;
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.45;
}

.section {
    display: none;
}

.section.on {
    display: block;
    animation: ff-in .3s var(--ease) both;
}

@keyframes ff-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.note {
    font-size: 13px;
    line-height: 1.55;
    color: #7a5b1e;
    background: rgba(224, 133, 11, .09);
    border: 1px solid rgba(224, 133, 11, .28);
    border-radius: 10px;
    padding: 12px 14px;
    margin: 12px 0 4px;
}

.mapwrap {
    margin-top: 6px;
}

#pickCanvas {
    height: 320px;
    border-radius: 12px;
    border: 1px solid var(--line);
    overflow: hidden;
}

.coords {
    margin-top: 10px;
    font-size: 13px;
    color: var(--muted);
}

.coords b {
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.pin {
    width: 18px;
    height: 18px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 2px solid #fff;
    background: var(--accent);
    box-shadow: 0 1px 5px rgba(0, 0, 0, .35);
}

.agree {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    margin-top: 18px;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--ink);
}

.agree input {
    margin-top: 1px;
    width: 18px;
    height: 18px;
    flex: none;
    accent-color: var(--accent);
}

.agree a {
    color: var(--accent);
    font-weight: 500;
}

.btn {
    margin-top: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: 0;
    border-radius: 11px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 600;
    font-size: 15.5px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(241, 13, 13, .22);
    transition: transform .06s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}

.btn:hover {
    background: #d40b0b;
    box-shadow: 0 4px 16px rgba(241, 13, 13, .28);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 6px rgba(241, 13, 13, .2);
}

.btn[disabled] {
    opacity: .6;
    cursor: default;
    box-shadow: none;
}

.err {
    color: var(--accent);
    font-size: 13.5px;
    font-weight: 500;
    margin-top: 12px;
    min-height: 18px;
}

.result {
    display: none;
    margin-top: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 24px;
    background: var(--surface);
}

.result.on {
    display: block;
    animation: ff-in .35s var(--ease) both;
}

.result h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.result > p {
    margin: 0 0 16px;
    font-size: 14.5px;
    color: var(--muted);
    line-height: 1.6;
    max-width: 56ch;
}

.ff-contact {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-top: 18px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg);
}

.ff-contact__ava {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    flex: none;
    box-shadow: 0 2px 8px rgba(50, 45, 45, .16);
}

.ff-contact__note {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
}

.ff-contact__name {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    margin-top: 2px;
}

.ff-contact__role {
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.4;
    margin: 2px 0 6px;
}

.ff-contact__tel {
    font-size: 15px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

.ff-contact__tel:hover {
    text-decoration: underline;
}

@media (max-width: 560px) {
    .anketa {
        padding: 28px 16px 56px;
    }

    .ff-contact {
        flex-direction: row;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, .section.on, .result.on {
        animation: none !important;
        transition: none !important;
    }
}