/* Анкета «Светлый кабинет»: тёплая бумага, тёмные чернила, терракота.
   Шрифты лежат на сайте (static/fonts): Onest — текст, Spectral — заголовки. */

@font-face { font-family: 'Onest'; font-weight: 400; font-display: swap; src: url('/static/fonts/onest-cyrillic-400.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Onest'; font-weight: 400; font-display: swap; src: url('/static/fonts/onest-latin-400.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Onest'; font-weight: 500; font-display: swap; src: url('/static/fonts/onest-cyrillic-500.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Onest'; font-weight: 500; font-display: swap; src: url('/static/fonts/onest-latin-500.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Onest'; font-weight: 600; font-display: swap; src: url('/static/fonts/onest-cyrillic-600.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Onest'; font-weight: 600; font-display: swap; src: url('/static/fonts/onest-latin-600.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Spectral'; font-weight: 500; font-display: swap; src: url('/static/fonts/spectral-cyrillic-500.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Spectral'; font-weight: 500; font-display: swap; src: url('/static/fonts/spectral-latin-500.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
    --paper: #F7F2EC;        /* фон страницы */
    --sheet: #FFFCF8;        /* лист анкеты, поля */
    --ink: #2B2420;          /* основной текст */
    --ink-2: #6B5F57;        /* второстепенный текст (контраст 5,3:1 на --paper) */
    --line: #E4D9CD;         /* линии и рамки */
    --line-2: #CDBFB1;
    --accent: #A4523A;       /* терракота: выбранное, ссылки (5,1:1 на --paper) */
    --accent-soft: #F3E1D7;
    --accent-ink: #7E3B27;
    --danger: #B42318;
    --radius: 14px;
    --serif: 'Spectral', Georgia, 'Times New Roman', serif;
    --sans: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 16px/1.5 var(--sans);
    -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: 3px; }
p { margin: 0; }

.page {
    max-width: 560px;
    margin: 0 auto;
    padding: max(20px, env(safe-area-inset-top)) 16px 32px;
}

/* --- Шапка: кто спрашивает --- */
.who {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 14px;
    align-items: center;
    padding: 4px 4px 20px;
}
.avatar {
    width: 72px; height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--line-2);
}
.avatar-initials {
    display: grid; place-items: center;
    background: var(--accent-soft);
    color: var(--accent-ink);
    font: 500 22px/1 var(--serif);
    letter-spacing: 0.02em;
}
.who-name { font: 500 22px/1.2 var(--serif); }
.who-title { color: var(--ink-2); font-size: 15px; }
.badges {
    grid-column: 1 / -1;
    list-style: none;
    margin: 14px 0 0; padding: 12px 0 0;
    border-top: 1px solid var(--line);
    display: grid; gap: 4px;
    font-size: 14px; color: var(--ink-2);
}
.badges li { display: flex; gap: 8px; align-items: baseline; }
.badges li::before {
    content: ''; flex: none;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent);
    transform: translateY(-2px);
}

/* --- Лист анкеты --- */
.sheet {
    background: var(--sheet);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 20px 18px 22px;
}
@media (min-width: 480px) { .sheet { padding: 26px 28px 28px; } }

.progress { margin-bottom: 18px; }
.progress-label {
    display: flex; justify-content: space-between;
    font-size: 13px; color: var(--ink-2);
    margin-bottom: 8px;
}
.progress-track { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.progress-fill {
    height: 100%; width: 100%;
    background: var(--accent);
    transform-origin: left;
    transform: scaleX(0.2);
    transition: transform 0.35s cubic-bezier(.2,.7,.3,1);
}

/* --- Шаги --- */
.step { border: 0; margin: 0; padding: 0; min-width: 0; }
.step.entering { animation: stepIn 0.28s cubic-bezier(.2,.7,.3,1); }
@keyframes stepIn { from { opacity: 0; transform: translateY(8px); } }
.step-title {
    padding: 0;
    font: 500 28px/1.15 var(--serif);
    letter-spacing: -0.01em;
    outline: none;
}
.step-lead { color: var(--ink-2); margin: 6px 0 18px; }

.field { margin-bottom: 18px; }
.field-short input { max-width: 140px; }
label, .label { display: block; font-weight: 500; margin-bottom: 8px; }
.muted { color: var(--ink-2); font-weight: 400; font-size: 14px; margin-left: 4px; }

input[type=text], input[type=number], input[type=tel], input[type=date], input[type=time], textarea {
    width: 100%;
    font: inherit;
    color: var(--ink);
    background: var(--sheet);
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    padding: 12px 14px;
    min-height: 48px;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none; appearance: none;
}
textarea { resize: vertical; min-height: 88px; }
input::placeholder, textarea::placeholder { color: #A99C91; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[aria-invalid=true], textarea[aria-invalid=true] { border-color: var(--danger); }
#contact { margin-top: 10px; }

.err { color: var(--danger); font-size: 14px; margin-top: 6px; }
.err:empty { display: none; }

/* --- Кнопки-варианты --- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    font: 500 15px/1.2 var(--sans);
    color: var(--ink);
    background: var(--sheet);
    border: 1px solid var(--line-2);
    border-radius: 999px;
    padding: 11px 16px;
    min-height: 44px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex; align-items: center;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}
.chip:hover { border-color: var(--accent); }
.chip:active { transform: scale(0.96); }
.chip[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chips-small .chip { font-size: 14px; padding: 8px 12px; min-height: 38px; }
.chips-wide { flex-direction: column; }
.chips-wide .chip { justify-content: center; min-height: 52px; }
@media (min-width: 480px) { .chips-wide { flex-direction: row; } .chips-wide .chip { flex: 1; } }

/* --- Карта лица --- */
.face-block {
    margin: 22px 0 18px;
    padding: 16px 14px;
    background: var(--paper);
    border-radius: var(--radius);
}
.face { display: block; width: 100%; max-width: 240px; height: auto; margin: 4px auto 14px; touch-action: manipulation; }
.face-skin { fill: #F5E6DC; stroke: #CBB2A2; stroke-width: 1.5; }
.face-line { fill: none; stroke: #A08779; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.face-line.soft { stroke: #CDB8AA; stroke-dasharray: 3 4; }
.zone { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.zone > * {
    fill: rgba(164, 82, 58, 0.04);
    stroke: rgba(164, 82, 58, 0.45);
    stroke-width: 1.2;
    stroke-dasharray: 3 3;
    transition: fill 0.15s, stroke 0.15s;
}
.zone:hover > * { fill: rgba(164, 82, 58, 0.14); }
.zone.on > * { fill: rgba(164, 82, 58, 0.38); stroke: var(--accent); stroke-dasharray: none; stroke-width: 1.6; }

/* --- Согласие --- */
.consent {
    display: flex; gap: 12px; align-items: flex-start;
    font-weight: 400; font-size: 14px; line-height: 1.5; color: var(--ink-2);
    padding: 14px; margin: 4px 0 0;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--paper);
    cursor: pointer;
}
.consent input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--accent); }
.consent.invalid { border-color: var(--danger); }

/* --- Фото --- */
.tips { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; }
.tips li { display: flex; gap: 10px; align-items: center; }
.tip-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--accent); flex: none; }
.upload {
    position: relative;
    display: grid; justify-items: center; gap: 2px;
    padding: 22px 16px;
    border: 1.5px dashed var(--line-2);
    border-radius: var(--radius);
    background: var(--paper);
    cursor: pointer;
    margin: 0;
    transition: border-color 0.15s, transform 0.1s;
}
.upload:hover { border-color: var(--accent); }
.upload:active { transform: scale(0.99); }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.upload-title { font-weight: 600; color: var(--accent-ink); }
.upload-hint { font-weight: 400; font-size: 14px; color: var(--ink-2); }
.photo-status { font-size: 14px; color: var(--ink-2); margin-top: 8px; white-space: pre-line; }
.photo-status:empty { display: none; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.photo-grid:empty { display: none; }
.photo { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--line); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo button {
    position: absolute; top: 4px; right: 4px;
    width: 30px; height: 30px; border-radius: 50%;
    border: 0; background: rgba(43, 36, 32, 0.75); color: #fff;
    font-size: 18px; line-height: 1; cursor: pointer;
}
.photo button:active { transform: scale(0.92); }

/* --- Запись --- */
.booking { margin-top: 18px; display: grid; gap: 0 12px; }
@media (min-width: 420px) { .booking { grid-template-columns: 1fr 1fr; } }

/* --- Навигация --- */
.form-error {
    margin: 4px 0 0; padding: 12px 14px;
    border-radius: var(--radius);
    background: #FCEDEB; color: var(--danger); font-size: 15px;
}
.nav { display: flex; align-items: center; gap: 12px; margin-top: 24px; }
.btn {
    margin-left: auto;
    font: 600 16px/1 var(--sans);
    color: var(--paper);
    background: var(--ink);
    border: 0; border-radius: var(--radius);
    padding: 0 28px; min-height: 52px;
    cursor: pointer;
    transition: background-color 0.15s, transform 0.1s;
}
.btn:hover { background: #463A33; }
.btn:active { transform: scale(0.97); }
.btn:focus-visible, .btn-back:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn-back {
    font: 500 16px/1 var(--sans);
    color: var(--ink-2); background: none; border: 0;
    padding: 0 6px; min-height: 52px; cursor: pointer;
}
.btn-back:hover { color: var(--ink); }
.btn-back:active { transform: scale(0.97); }
@media (max-width: 420px) { .btn { flex: 1; } }

/* --- Отправка и финал --- */
.loader { text-align: center; padding: 48px 0; color: var(--ink-2); }
.spinner {
    width: 36px; height: 36px; margin: 0 auto 12px;
    border-radius: 50%;
    border: 3px solid var(--accent-soft); border-top-color: var(--accent);
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.done { padding: 8px 0; }
.done-title { font: 500 28px/1.15 var(--serif); margin: 0 0 10px; outline: none; }
.done-text { color: var(--ink-2); }
.done-text strong { color: var(--ink); font-weight: 600; }
.done-lead { margin: 22px 0 10px; font-weight: 500; }
.done-links { display: flex; flex-wrap: wrap; gap: 8px; }

.foot { text-align: center; padding: 20px 0 0; font-size: 13px; }
.foot a { color: var(--ink-2); }

/* Ловушка для ботов: убрана с экрана, но не display:none (часть ботов это проверяет) */
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
    .step.entering, .spinner { animation: none; }
    .progress-fill, .chip, .btn, .zone > * { transition: none; }
}

/* --- Политика и согласие --- */
.legal { background: var(--sheet); border: 1px solid var(--line); border-radius: 20px; padding: 22px 20px 26px; }
@media (min-width: 480px) { .legal { padding: 30px 32px; } }
.legal h1 { font: 500 28px/1.2 var(--serif); margin: 12px 0 4px; }
.legal h2 { font: 600 17px/1.3 var(--sans); margin: 26px 0 8px; }
.legal p, .legal li { line-height: 1.65; margin-bottom: 8px; }
.legal ul { padding-left: 20px; margin: 0 0 8px; }
.legal .meta { color: var(--ink-2); font-size: 13px; }
.legal .todo { color: #8A5200; background: #FFF1D6; border-radius: 4px; padding: 0 4px; }
