/* Дизайн-система «Вода Плюс» — Шаг 0 макетов.
   Светлая тема — значения по умолчанию, тёмная переопределяет только роли. */

:root {
    /* фирменные цвета — одинаковы в обеих темах */
    --blue: #1860B8;
    --blue-lt: #3070D0;
    --green: #36C09C;
    --green-dk: #2AA384;
    --danger: #D25353;

    /* роли — светлая тема */
    --bg: #F7FAFF;
    --bg-hero: #F7FAFF;
    --surface: #fff;
    --surface-2: #EDF3FB;
    --ink: #0F172A;
    --sub: #44536B;
    --muted: #7A8A9A;
    --line: #DCE6F2;
    --line-soft: #EDF3FB;
    --accent: var(--blue);
    --accent-soft: #E8F0FB;
    --green-soft: #E4F6F0;
    --logo: url(../assets/logo-w1-transparent.webp);
    --sh-card: 0 1px 2px rgba(14, 42, 82, .06), 0 8px 24px rgba(14, 42, 82, .08);
    --sh-pop: 0 4px 12px rgba(14, 42, 82, .12), 0 16px 48px rgba(14, 42, 82, .16);
    /* панель навигации лежит поверх контента — фон непрозрачный, не surface */
    --tabbar-bg: #fff;

    --tabbar-h: 60px;
    --r-s: 10px;
    --r-m: 16px;
    --r-l: 24px;
    --ease: cubic-bezier(.22, .8, .36, 1);
    --t-fast: .15s;
    --t-med: .3s;
    --t-slow: .6s;

    font-size: 16px;
    color-scheme: light;
}

:root[data-theme="dark"] {
    --bg: #0E2A52;
    --bg-hero: linear-gradient(175deg, #0E2A52 0%, #123561 55%, #16407A 82%, #0E2A52 100%);
    --surface: rgba(255, 255, 255, .06);
    --surface-2: rgba(255, 255, 255, .10);
    --ink: #fff;
    --sub: #C7D5EA;
    --muted: #9FB2CC;
    --line: rgba(255, 255, 255, .14);
    --line-soft: rgba(255, 255, 255, .08);
    --accent: #8FD8C3;
    --accent-soft: rgba(255, 255, 255, .12);
    --green-soft: rgba(54, 192, 156, .16);
    --logo: url(../assets/logo-w1-on-dark.webp);
    --sh-card: none;
    --sh-pop: 0 16px 48px rgba(0, 0, 0, .4);
    --tabbar-bg: #123561;

    color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0E2A52;
        --bg-hero: linear-gradient(175deg, #0E2A52 0%, #123561 55%, #16407A 82%, #0E2A52 100%);
        --surface: rgba(255, 255, 255, .06);
        --surface-2: rgba(255, 255, 255, .10);
        --ink: #fff;
        --sub: #C7D5EA;
        --muted: #9FB2CC;
        --line: rgba(255, 255, 255, .14);
        --line-soft: rgba(255, 255, 255, .08);
        --accent: #8FD8C3;
        --accent-soft: rgba(255, 255, 255, .12);
        --green-soft: rgba(54, 192, 156, .16);
        --logo: url(../assets/logo-w1-on-dark.webp);
        --sh-card: none;
        --sh-pop: 0 16px 48px rgba(0, 0, 0, .4);
        --tabbar-bg: #123561;

        color-scheme: dark;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Inter, system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: Manrope, Inter, sans-serif;
    font-weight: 800;
    line-height: 1.15;
    text-wrap: balance;
}

h1 { font-size: 1.9rem; line-height: 1.12; }
h2 { font-size: 1.4rem; }
h3 { font-weight: 700; font-size: 1.1rem; }

a {
    color: var(--blue);
    text-decoration: none;
}

a:hover { color: var(--blue-lt); }

:root[data-theme="dark"] a { color: var(--accent); }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) a { color: var(--accent); }
}

img { max-width: 100%; }

[hidden] { display: none !important; }

:focus-visible {
    outline: 3px solid var(--blue-lt);
    outline-offset: 2px;
}

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

/* --- кнопки --- */

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: 700 1rem Manrope, sans-serif;
    border: none;
    border-radius: 14px;
    min-height: 54px;
    width: 100%;
    padding: 0 24px;
    cursor: pointer;
    transition: transform var(--t-fast) var(--ease), background var(--t-fast), box-shadow var(--t-fast);
}

.btn:active { transform: scale(.97); }

.btn-primary {
    background: var(--green);
    color: #fff;
    box-shadow: 0 2px 10px rgba(54, 192, 156, .4);
    flex-direction: column;
    gap: 2px;
    padding: 8px 24px;
}

.btn-primary small {
    font: 600 .74rem Inter, sans-serif;
    opacity: .9;
}

.btn-primary:hover { background: var(--green-dk); }

.btn-secondary {
    background: var(--blue);
    color: #fff;
}

.btn-secondary:hover { background: var(--blue-lt); }

/* кнопка с подписью во второй строке */
.btn-stack {
    flex-direction: column;
    gap: 2px;
    padding: 8px 24px;
}

.btn-stack small {
    font: 600 .74rem Inter, sans-serif;
    opacity: .9;
}

.btn-ghost {
    background: var(--surface);
    color: var(--blue);
    box-shadow: inset 0 0 0 2px var(--line);
}

/* третья кнопка в шапке — не действие, а пояснение: без рамки и фона */
.btn-link {
    background: none;
    color: var(--blue);
    min-height: 44px;
    font: 600 .92rem Inter, sans-serif;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.btn-link:hover { color: var(--blue-lt); }

:root[data-theme="dark"] .btn-link { color: var(--accent); }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .btn-link { color: var(--accent); }
}

.btn-ghost:hover { box-shadow: inset 0 0 0 2px var(--blue-lt); }

:root[data-theme="dark"] .btn-ghost { color: #fff; box-shadow: none; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .btn-ghost { color: #fff; box-shadow: none; }
}

.btn:disabled {
    background: var(--line);
    color: var(--muted);
    box-shadow: none;
    cursor: not-allowed;
}

/* --- поля --- */

.field {
    display: grid;
    gap: 6px;
}

.field label {
    font-size: .85rem;
    font-weight: 600;
}

.field input,
.field select,
.field textarea {
    font: inherit;
    color: var(--ink);
    padding: 13px 16px;
    border: 2px solid var(--line);
    border-radius: var(--r-s);
    background: var(--surface);
    min-height: 50px;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--blue-lt);
    box-shadow: 0 0 0 4px rgba(48, 112, 208, .12);
}

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

.field.err input { border-color: var(--danger); }
.field.err .hint { color: var(--danger); }

/* --- карточки, чипы --- */

.card {
    background: var(--surface);
    border-radius: var(--r-l);
    box-shadow: var(--sh-card);
    padding: 22px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 600;
}

.chip-blue { background: var(--accent-soft); color: var(--blue); }
.chip-green { background: var(--green-soft); color: var(--green-dk); }

:root[data-theme="dark"] .chip-blue { color: #DCE9FA; }
:root[data-theme="dark"] .chip-green { color: var(--green); }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .chip-blue { color: #DCE9FA; }
    :root:not([data-theme="light"]) .chip-green { color: var(--green); }
}

/* --- motion --- */

.breathe {
    animation: breathe 2.6s var(--ease) infinite;
    transform-origin: center;
}

@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.07); }
}

.bump { animation: bump .4s var(--ease); }

@keyframes bump {
    30% { transform: scale(1.06); color: var(--green-dk); }
}

.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
}

.reveal.in {
    opacity: 1;
    transform: none;
}

.skel {
    height: 14px;
    border-radius: 7px;
    background: linear-gradient(90deg, var(--line) 25%, var(--line-soft) 50%, var(--line) 75%);
    background-size: 200% 100%;
    animation: skel 1.4s linear infinite;
}

@keyframes skel {
    to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .breathe, .skel, .bump, .reveal {
        animation: none;
        transition: none;
        opacity: 1;
        transform: none;
    }
}
