/* corte. — премиальный пастельный travel-стиль */
:root {
    color-scheme: light;
    --bg: #F2F6F9;
    --surface: #FFFFFF;
    --surface-2: #FBFCFD;     /* мягкая подложка карточек/полей */
    --header-bg: rgba(242, 246, 249, 0.85);
    --result-grad: linear-gradient(160deg, #FBF3F0, #F2F6F9);
    --text: #4A3E3D;
    --muted: #8A7E7C;
    --accent: #C98B7E;        /* пыльный терракот */
    --accent-dark: #B5746A;
    --accent-soft: #E8D5CF;   /* пыльная роза */
    --on-accent: #FFFFFF;     /* текст на акцентном фоне */
    --line: #E2E9EE;
    --ok-bg: #E3F0E6;
    --ok-fg: #3F7A52;
    --err-bg: #F6E2DF;
    --err-fg: #B5746A;
    --radius: 20px;
    --radius-lg: 24px;
    --shadow: 0 12px 40px rgba(74, 62, 61, 0.08);
    --shadow-soft: 0 6px 20px rgba(74, 62, 61, 0.06);
}

/* ===================== ТЁМНАЯ ТЕМА ===================== */
[data-theme="dark"] {
    color-scheme: dark;
    --bg: #14110F;
    --surface: #201B19;
    --surface-2: #262120;
    --header-bg: rgba(20, 17, 15, 0.85);
    --result-grad: linear-gradient(160deg, #2A211E, #1A1614);
    --text: #EDE6E3;
    --muted: #A99E9A;
    --accent: #D79A8D;
    --accent-dark: #E2AEA2;
    --accent-soft: #4A3A35;
    --on-accent: #1A1311;
    --line: #38302D;
    --ok-bg: #1E3326;
    --ok-fg: #84C99B;
    --err-bg: #3A2420;
    --err-fg: #E2A99E;
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    --shadow-soft: 0 6px 20px rgba(0, 0, 0, 0.35);
}

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

body {
    font-family: "Inter", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ШАПКА */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px clamp(20px, 5vw, 64px);
    position: sticky;
    top: 0;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    z-index: 20;
    border-bottom: 1px solid var(--line);
}
.logo {
    font-family: "Montserrat", sans-serif;
    font-weight: 800;
    font-size: 26px;
    letter-spacing: -0.5px;
    color: var(--text);
    text-decoration: none;
}
.logo span { color: var(--accent); }
.nav { display: flex; gap: clamp(14px, 3vw, 34px); }
.nav-link {
    text-decoration: none;
    color: var(--muted);
    font-weight: 500;
    font-size: 15px;
    position: relative;
    transition: color .2s;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--accent); }
.nav-link.active::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -6px;
    height: 2px; border-radius: 2px;
    background: var(--accent);
}

main { flex: 1; padding: clamp(24px, 5vw, 56px) clamp(20px, 5vw, 64px); }

/* VIEWS */
.view { display: none; animation: fade .4s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* HERO */
.hero { text-align: center; padding: clamp(40px, 8vw, 90px) 0 50px; }
.hero-eyebrow {
    text-transform: uppercase;
    letter-spacing: 4px;
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 18px;
}
.hero-title {
    font-family: "Montserrat", sans-serif;
    font-weight: 800;
    font-size: clamp(64px, 16vw, 168px);
    letter-spacing: clamp(-2px, -0.5vw, -6px);
    line-height: .9;
    color: var(--text);
}
.hero-sub {
    margin: 22px auto 0;
    max-width: 540px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 14px;
    color: var(--muted);
    font-weight: 500;
}
.hero-actions { margin-top: 36px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.hero-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    max-width: 960px;
    margin: 30px auto 0;
}
.mini-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--line);
}
.mini-ico {
    display: inline-flex;
    width: 46px; height: 46px;
    align-items: center; justify-content: center;
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 20px;
    margin-bottom: 14px;
}
.mini-card h3 { font-size: 17px; margin-bottom: 6px; }
.mini-card p { color: var(--muted); font-size: 14px; }

/* PANELS */
.panel {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: clamp(24px, 4vw, 44px);
    max-width: 920px;
    margin: 0 auto;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
}
.panel.narrow { max-width: 560px; }
.panel-title { font-family: "Montserrat", sans-serif; font-size: 28px; font-weight: 700; }
.panel-sub { color: var(--muted); margin: 8px 0 26px; font-size: 15px; }

/* FORM */
.block {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 22px;
    background: var(--surface-2);
}
.block legend {
    padding: 0 10px;
    font-weight: 600;
    color: var(--accent-dark);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.block.hidden { display: none; }
.hidden { display: none !important; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field input, .segment input { min-width: 0; width: 100%; }
.field span { font-size: 13px; color: var(--muted); font-weight: 500; }
input[type="text"],
input[type="number"],
input[list] {
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    transition: border-color .2s, box-shadow .2s;
}
input[type="text"]:focus,
input[type="number"]:focus,
input[list]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(201, 139, 126, 0.15);
}

/* Тумблеры в форме поиска */
.search-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    margin: 4px 0 18px;
}
.search-toggles .switch-row.inline-toggle { margin: 0; }

/* Маршрут «туда/обратно» в карточке оффера */
.leg-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0;
}
.leg-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 6px;
    padding: 2px 8px;
    margin-right: 4px;
}

/* SEGMENTS */
.segment {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px 12px;
    align-items: end;
    padding: 16px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    margin-bottom: 12px;
    position: relative;
}
.segment .seg-remove { position: absolute; top: 10px; right: 10px; }
.segment .time-pair { display: flex; gap: 6px; }
.segment .time-pair input { width: 100%; }
.seg-remove {
    border: none;
    background: var(--accent-soft);
    color: var(--accent-dark);
    border-radius: 10px;
    height: 44px;
    cursor: pointer;
    font-size: 18px;
    transition: background .2s;
}
.seg-remove:hover { background: var(--accent); color: var(--on-accent); }

.add-seg { margin-top: 4px; }

/* SWITCH */
.switch-row { display: flex; align-items: center; gap: 12px; margin: 6px 0 22px; cursor: pointer; user-select: none; }
.switch-row input { display: none; }
.switch {
    width: 46px; height: 26px;
    background: var(--line);
    border-radius: 999px;
    position: relative;
    transition: background .2s;
}
.switch::after {
    content: ""; position: absolute; top: 3px; left: 3px;
    width: 20px; height: 20px; border-radius: 50%;
    background: #fff; box-shadow: var(--shadow-soft);
    transition: transform .2s;
}
.switch-row input:checked + .switch { background: var(--accent); }
.switch-row input:checked + .switch::after { transform: translateX(20px); }
.switch-label { font-weight: 500; }

/* BUTTONS */
.btn {
    font-family: inherit;
    font-weight: 600;
    font-size: 15px;
    border: none;
    border-radius: 999px;
    padding: 13px 26px;
    cursor: pointer;
    transition: transform .15s, background .2s, box-shadow .2s;
}
.btn:active { transform: translateY(1px); }
.btn-accent { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-soft); }
.btn-accent:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; color: var(--accent-dark); border: 1.5px solid var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-soft { background: var(--accent-soft); color: var(--accent-dark); padding: 10px 18px; font-size: 14px; }
.btn-soft:hover { background: #ddc1ba; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.form-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.form-status { color: var(--muted); font-size: 14px; }

/* RESULT */
.result-card {
    margin-top: 26px;
    text-align: center;
    padding: 32px;
    border-radius: var(--radius);
    background: var(--result-grad);
    border: 1px solid var(--accent-soft);
}
.result-check {
    width: 58px; height: 58px; margin: 0 auto 14px;
    border-radius: 50%; background: var(--accent); color: var(--on-accent);
    display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.res-code {
    font-family: "Montserrat", monospace;
    font-size: 38px; font-weight: 800; letter-spacing: 8px;
    color: var(--accent-dark); margin: 10px 0;
}

/* PROFILE */
.profile-card { display: flex; gap: 22px; align-items: center; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.avatar { width: 72px; height: 72px; border-radius: 22px; background: var(--accent-soft); color: var(--accent-dark); display: flex; align-items: center; justify-content: center; font-family: "Montserrat"; font-weight: 800; font-size: 26px; }
.profile-stats { display: flex; gap: 28px; margin-top: 14px; }
.profile-stats b { font-size: 22px; display: block; color: var(--accent-dark); }
.profile-stats span { font-size: 12px; color: var(--muted); }
.recent-codes { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.recent-codes .chip { background: var(--accent-soft); color: var(--accent-dark); padding: 6px 14px; border-radius: 999px; font-weight: 600; letter-spacing: 2px; }

/* VERIFY */
.verify-form { display: flex; gap: 12px; margin-bottom: 20px; }
.verify-form input {
    flex: 1; text-align: center; text-transform: uppercase;
    font-size: 24px; letter-spacing: 8px; font-weight: 700;
    font-family: "Montserrat", monospace;
}
.verify-result:empty { display: none; }
.status-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--ok-bg); color: var(--ok-fg);
    padding: 8px 18px; border-radius: 999px; font-weight: 700;
    margin-bottom: 18px;
}
.status-badge.error { background: var(--err-bg); color: var(--err-fg); }
.status-badge .dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }

.verify-pax { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.verify-pax .cell { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.verify-pax .cell small { color: var(--muted); font-size: 12px; display: block; }
.verify-result .cell small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.verify-pax .cell b { font-size: 16px; }

.itin-title { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--accent-dark); font-weight: 600; margin: 18px 0 8px; }
.itin {
    display: grid; grid-template-columns: 1fr auto 1fr;
    align-items: center; gap: 14px;
    background: var(--surface-2); border: 1px solid var(--line);
    border-radius: 14px; padding: 16px 20px; margin-bottom: 10px;
}
.itin .port { text-align: center; }
.itin .port b { font-size: 22px; font-family: "Montserrat"; display: block; }
.itin .port small { color: var(--muted); }
.itin .mid { text-align: center; color: var(--accent); }
.itin .mid .plane { font-size: 18px; }
.itin .mid small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }

/* FOOTER */
.site-footer {
    display: flex; justify-content: space-between;
    padding: 24px clamp(20px, 5vw, 64px);
    border-top: 1px solid var(--line);
    font-family: "Montserrat"; font-weight: 700;
}
.muted { color: var(--muted); }
.small { font-size: 13px; }

@media (max-width: 720px) {
    .grid-3 { grid-template-columns: 1fr 1fr; }
    .segment { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .segment { grid-template-columns: 1fr; }
    .seg-remove { grid-column: span 2; }
    .verify-pax { grid-template-columns: 1fr; }
}

/* ===================== ПОИСК РЕЙСОВ ===================== */
.switch-inline { justify-content: flex-start; }
.switch-inline .switch-row.inline { display: inline-flex; align-items: center; gap: 8px; margin: 6px 0 0; }

.search-results { margin-top: 22px; display: flex; flex-direction: column; gap: 14px; }

.offer-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-soft);
    transition: transform .15s ease, box-shadow .15s ease;
}
.offer-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.offer-main { display: flex; align-items: center; gap: 20px; flex: 1 1 360px; min-width: 280px; }
.offer-price {
    font-family: "Montserrat", sans-serif;
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--accent-dark);
    white-space: nowrap;
}
.offer-info { display: flex; flex-direction: column; gap: 6px; }
.offer-airline { font-weight: 700; font-size: 1.02rem; }
.offer-flight { color: var(--muted); font-weight: 500; font-size: .9rem; margin-left: 4px; }
.offer-meta { display: flex; align-items: center; gap: 10px; font-size: .85rem; }

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .3px;
}
.badge-direct { background: var(--ok-bg); color: var(--ok-fg); }

.offer-route { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .85rem; color: var(--text); }
.seg-chip { display: inline-flex; align-items: center; gap: 5px; }
.seg-chip small { color: var(--muted); }
.seg-arrow { color: var(--accent); }
.seg-sep { color: var(--line); }

.offer-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.offer-actions .btn { white-space: nowrap; }

@media (max-width: 640px) {
    .offer-card { flex-direction: column; align-items: flex-start; }
    .offer-actions { width: 100%; }
}

/* ===================== ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ ===================== */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--accent-dark);
    font-size: 17px;
    cursor: pointer;
    transition: background .2s, color .2s, transform .15s, border-color .2s;
}
.theme-toggle:hover { background: var(--accent-soft); border-color: var(--accent); transform: translateY(-1px); }
.theme-toggle:active { transform: translateY(0); }
.theme-toggle .theme-ico-light { display: none; }
.theme-toggle .theme-ico-dark { display: inline; }
[data-theme="dark"] .theme-toggle .theme-ico-light { display: inline; }
[data-theme="dark"] .theme-toggle .theme-ico-dark { display: none; }

/* Тёмная тема: едва заметная корректировка теней/границ карточек */
[data-theme="dark"] .offer-card,
[data-theme="dark"] .mini-card,
[data-theme="dark"] .panel { border-color: var(--line); }
[data-theme="dark"] input::placeholder { color: var(--muted); opacity: .8; }

/* --- Предупреждение в форме бронирования ------------------------------- */
.notice {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 14px;
    margin: 4px 0 18px;
    font-size: 14px;
    line-height: 1.5;
}
.notice-warn {
    background: var(--accent-soft);
    color: var(--accent-dark);
    border: 1px solid var(--accent);
}
.notice-warn b { color: var(--accent-dark); }
.notice-ico { font-size: 20px; line-height: 1.3; flex: none; }
.check-reminder {
    margin: 10px 0 4px;
    font-size: 13px;
    color: var(--accent-dark);
    font-weight: 600;
}
