/* Форма обратной связи — корпоративный стиль «Фонтанки» */

/* --- Шрифты (локальные, OFL) ---------------------------------------------- */

@font-face {
    font-family: "Roboto";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("fonts/roboto-var-cyr.woff2") format("woff2");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: "Roboto";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("fonts/roboto-var-lat.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
        U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
        U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Roboto Slab";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("fonts/roboto-slab-600-cyr.woff2") format("woff2");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: "Roboto Slab";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("fonts/roboto-slab-600-lat.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
        U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
        U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Палитра «Фонтанки» --------------------------------------------------- */

:root {
    --bg: #f5f5f5;
    --card: #ffffff;
    --navy: #00204c;
    --navy-soft: #1b385e;
    --text: #37404d;
    --muted: #77808c;
    --line: #e6e6e6;
    --field: #f5f5f5;
    --accent: #e68135;
    --accent-hover: #d47731;
    --success: #36b274;
    --success-soft: #c3e8d5;
    --error: #e54545;
    --error-soft: #fdeeee;
    --radius: 8px;

    --header-bg: var(--navy);
    --header-text: #ffffff;
    --header-note: rgba(255, 255, 255, 0.6);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0 0 56px;
    font-family: "Roboto", Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.4;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

/* --- Шапка сайта ---------------------------------------------------------- */

.site-header {
    color: var(--header-text);
    background: var(--header-bg);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    max-width: 767px;
    height: 76px;
    margin: 0 auto;
    padding: 0 16px;
}

.site-header__logo {
    display: block;
    flex: 0 0 auto;
}

.site-header__logo img {
    display: block;
    width: auto;
    height: 30px;
}

.site-header__note {
    font-size: 13px;
    letter-spacing: 0.02em;
    color: var(--header-note);
    text-align: right;
}

/* --- Страница ------------------------------------------------------------- */

.page {
    width: 100%;
    max-width: 767px;
    margin: 0 auto;
    padding: 32px 16px 0;
}

.card {
    padding: 40px;
    background: var(--card);
    border: 1px solid #efefef;
    border-radius: 16px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

/* --- Интро ---------------------------------------------------------------- */

.intro {
    padding-bottom: 26px;
    margin-bottom: 34px;
    border-bottom: 3px solid var(--navy);
}

.eyebrow {
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}

.h1 {
    margin: 0 0 34px;
    font-family: "Roboto Slab", "Roboto", Georgia, serif;
    font-size: clamp(30px, 5vw, 42px);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: var(--navy);
}

.lead {
    max-width: 58ch;
    margin: 0;
    font-size: 16px;
    line-height: 1.55;
    color: var(--muted);
}

.lead + .lead {
    margin-top: 6px;
}

/* --- Секции --------------------------------------------------------------- */

.section {
    margin: 0 0 46px;
}

.section:last-of-type {
    margin-bottom: 0;
}

.section--highlight {
    padding: 26px 22px;
    background: #fdf8f2;
    border: 1px solid #f0e3d5;
    border-radius: 12px;
}

.callout {
    padding: 15px 18px;
    margin: 0 0 14px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--navy-soft);
    background: #fdf1e7;
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.section__head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding-bottom: 10px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--line);
}

.section__num {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--accent);
}

.section__title {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--navy);
}

/* --- Поля ----------------------------------------------------------------- */

.field {
    min-width: 0;
    padding: 0;
    margin: 0 0 22px;
    border: 0;
}

.field--radio,
.field--group {
    margin-bottom: 32px;
}

.field > legend {
    padding: 0;
}

.field__label {
    display: block;
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--navy-soft);
}

.field__hint {
    margin: -2px 0 12px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--muted);
}

.req {
    margin-left: 3px;
    font-weight: 700;
    color: var(--accent);
}

.required-note {
    margin: 0 0 24px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--muted);
}

.input {
    display: block;
    width: 100%;
    padding: 13px 15px;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.4;
    color: var(--text);
    background-color: var(--field);
    border: 2px solid transparent;
    border-radius: var(--radius);
    appearance: none;
    transition: border-color 0.2s ease, background-color 0.2s ease,
        box-shadow 0.2s ease;
}

textarea.input {
    min-height: 112px;
    resize: vertical;
}

select.input {
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2300204c' stroke-width='2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 12px 8px;
    cursor: pointer;
}

.input::placeholder {
    color: #8e8e8e;
    opacity: 1;
}

.input:hover {
    border-color: #d6d6d6;
}

.input:focus {
    outline: none;
    background-color: #fff;
    border-color: var(--navy);
    box-shadow: 0 0 0 4px rgba(0, 32, 76, 0.07);
}

.input:disabled {
    opacity: 0.6;
}

.input--error {
    background-color: var(--error-soft);
    border-color: var(--error);
}

.field__error {
    margin: 8px 0 0;
    font-size: 14px;
    line-height: 1.4;
    color: #c93b3b;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 12px;
}

.grid-2 > * {
    min-width: 0;
}

.grid-2 > .field {
    margin-bottom: 0;
}

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

.grid-1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.grid-1 > * {
    min-width: 0;
}

.grid-1 > .field {
    margin-bottom: 0;
}

/* --- Чекбоксы ------------------------------------------------------------- */

.check-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.check-grid--1 {
    grid-template-columns: 1fr;
}

.check {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 15px;
    line-height: 1.35;
    cursor: pointer;
}

.check input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
}

.check__box {
    position: relative;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    background: #fff;
    border: 2px solid #c7c7c7;
    border-radius: 4px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.check__box::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 6px;
    width: 6px;
    height: 11px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    opacity: 0;
    transform: rotate(45deg);
    transition: opacity 0.15s ease;
}

.check:hover .check__box {
    border-color: var(--accent);
}

.check input:checked + .check__box {
    background: var(--accent);
    border-color: var(--accent);
}

.check input:checked + .check__box::after {
    opacity: 1;
}

.check__box--radio {
    border-radius: 50%;
}

.check__box--radio::after {
    top: 5px;
    left: 5px;
    width: 10px;
    height: 10px;
    background: #fff;
    border: 0;
    border-radius: 50%;
    transform: none;
}

.check input:checked + .check__box--radio::after {
    opacity: 1;
}

.check input:focus-visible + .check__box {
    outline: 2px solid var(--navy);
    outline-offset: 2px;
}

.check__text {
    padding-top: 1px;
}

.check--consent {
    max-width: 62ch;
    margin-top: 10px;
    font-size: 15px;
    color: var(--muted);
}

/* --- Файл ----------------------------------------------------------------- */

.upload {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    padding: 14px 0 4px;
}

.upload__trigger {
    display: inline-block;
    font-size: 16px;
    font-weight: 500;
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.upload__trigger:hover {
    color: var(--accent-hover);
    text-decoration-color: transparent;
}

.upload__trigger--error {
    color: var(--error);
}

.upload__name {
    max-width: 100%;
    overflow: hidden;
    font-size: 14px;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload__name--multiple {
    white-space: normal;
}

/* --- Отправка ------------------------------------------------------------- */

.submit {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding-top: 28px;
    margin-top: 32px;
    border-top: 1px solid var(--line);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 220px;
    height: 52px;
    padding: 0 28px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: #fff;
    text-decoration: none;
    background: var(--accent);
    border: 0;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.btn:hover {
    background: var(--accent-hover);
}

.btn:focus-visible {
    outline: 2px solid var(--navy);
    outline-offset: 2px;
}

.btn:disabled {
    color: #8e8e8e;
    background: var(--line);
    cursor: default;
}

.btn--ghost {
    color: var(--navy);
    background: transparent;
    border: 2px solid var(--navy);
}

.btn--ghost:hover {
    color: #fff;
    background: var(--navy);
}

.note {
    max-width: 54ch;
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
}

.note--center {
    margin: 24px auto 0;
    text-align: center;
}

.notice {
    padding: 14px 16px;
    margin-bottom: 26px;
    font-size: 14px;
    line-height: 1.5;
    border-left: 4px solid var(--error);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.notice--error {
    color: #a82f2f;
    background: var(--error-soft);
}

/* --- Экран успеха --------------------------------------------------------- */

.card--success {
    padding: 48px 40px 44px;
}

.plaque {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    padding: 24px;
    background: var(--success-soft);
    border-left: 4px solid var(--success);
    border-radius: 0 var(--radius) var(--radius) 0;
    animation: rise 0.45s ease both;
}

.plaque__icon {
    display: grid;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    color: #fff;
    background: var(--success);
    border-radius: 50%;
    place-items: center;
}

.plaque__title {
    margin: 2px 0 8px;
    font-family: "Roboto Slab", "Roboto", Georgia, serif;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--navy);
}

.plaque__text {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    color: #2a5c43;
}

.success__actions {
    margin-top: 30px;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* --- Служебное ------------------------------------------------------------ */

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.config-error {
    padding: 16px;
    margin-top: 22px;
    overflow: auto;
    font-family: "Roboto Mono", monospace;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
    white-space: pre-wrap;
    background: var(--field);
    border-radius: var(--radius);
}

.footer {
    margin-top: 20px;
    font-size: 12px;
    letter-spacing: 0.02em;
    text-align: center;
    color: var(--muted);
}

/* --- Адаптив -------------------------------------------------------------- */

@media (max-width: 680px) {
    body {
        padding-bottom: 36px;
    }

    .site-header__inner {
        height: 64px;
        padding: 0 16px;
    }

    .site-header__logo img {
        height: 26px;
    }

    .site-header__note {
        display: none;
    }

    .page {
        padding: 16px 12px 0;
    }

    .card,
    .card--success {
        padding: 26px 18px 30px;
        border-radius: 12px;
    }

    .intro {
        margin-bottom: 30px;
    }

    .lead {
        font-size: 15px;
    }

    .h1 {
        margin-bottom: 26px;
    }

    .section {
        margin-bottom: 36px;
    }

    .section--highlight {
        padding: 20px 16px;
    }

    .section__title {
        font-size: 11.5px;
        letter-spacing: 0.08em;
    }

    .field__label {
        font-size: 16px;
    }

    .field--radio,
    .field--group {
        margin-bottom: 28px;
    }

    .grid-2,
    .check-grid {
        grid-template-columns: 1fr;
    }

    .submit {
        align-items: stretch;
    }

    .btn {
        width: 100%;
    }

    .plaque {
        flex-direction: column;
        gap: 14px;
        padding: 20px;
    }

    .plaque__title {
        font-size: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001s !important;
        transition-duration: 0.001s !important;
    }
}
