/* Веб-калькулятор компенсаций. Цвета — как у главной страницы сайта (public/index.html). */
:root {
  --bg: #ffffff; --surface: #f6f7f9; --text: #1c1e21; --muted: #5b6470; --border: #e3e6ea;
  --accent: #2f6fed; --accent-soft: #eaf1fe; --ok: #1f8a4c; --warn: #b8740a;
  --sky-top: #cfe2ff; --sky-bottom: #f4f8ff; --cloud: #ffffff; --trail: #8fb3f5; --ticket: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115; --surface: #181b21; --text: #e7e9ec; --muted: #9aa3af; --border: #262b33;
    --accent: #5b8dff; --accent-soft: #182338; --ok: #4cc27f; --warn: #e2a33b;
    --sky-top: #0b1a3d; --sky-bottom: #0f1115; --cloud: #1b2a4a; --trail: #3d5ea8; --ticket: #181b21;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55; font-size: 16px;
}
.wrap { max-width: 680px; margin: 0 auto; padding: 16px 16px 64px; }

/* --- Шапка: небо, облака, инверсионный след и самолёт --- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 100%);
  border-bottom: 1px solid var(--border);
}
.hero .wrap { position: relative; padding-bottom: 18px; }
.hero .sky { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 120px; pointer-events: none; }
.hero .trail { stroke: var(--trail); stroke-width: 2; stroke-dasharray: 6 7; stroke-linecap: round; opacity: .8; }
.hero .cloud { fill: var(--cloud); opacity: .9; }
.hero .cloud.small { opacity: .7; }
.hero .plane {
  position: absolute; width: 34px; height: 34px; fill: var(--accent);
  left: calc(63% - 17px); top: 30px; transform: rotate(62deg);
  filter: drop-shadow(0 3px 4px rgba(0,0,0,.18));
  animation: glide 6s ease-in-out infinite;
}
@keyframes glide { 0%, 100% { translate: 0 0; } 50% { translate: 6px -5px; } }
@media (prefers-reduced-motion: reduce) { .hero .plane { animation: none; } }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 22px; min-height: 40px; }
.brand { display: inline-flex; align-items: center; gap: 6px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 19px; letter-spacing: .01em; }
.brand svg { width: 22px; height: 22px; fill: var(--accent); transform: rotate(45deg); }
.badge { display: inline-block; line-height: 0; }
.badge img { height: 40px; width: auto; }
h1 { font-size: 30px; line-height: 1.2; margin: 0 0 10px; }
.lead { color: var(--muted); margin: 0 0 22px; }
h2 { font-size: 21px; margin: 32px 0 8px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; margin-bottom: 12px; }
.card-title { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }

.route { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.field { position: relative; min-width: 0; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field input {
  width: 100%; font: inherit; padding: 11px 12px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.swap {
  font: inherit; font-size: 18px; width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg); color: var(--accent); margin-bottom: 1px;
}
.swap .v { display: none; }
.options {
  position: absolute; z-index: 10; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none;
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12);
  max-height: 320px; overflow-y: auto;
}
.options li { padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.options li[aria-selected="true"], .options li:hover { background: var(--accent-soft); }
.options .code { color: var(--muted); font-size: 13px; }
.options small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.options .empty { color: var(--muted); cursor: default; }

.q { margin-top: 14px; }
.q p { margin: 0 0 6px; font-size: 15px; }
.q[hidden] { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button {
  font: inherit; font-size: 14.5px; padding: 7px 13px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.chips button[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.check { display: flex; gap: 8px; align-items: center; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.result .verdict { margin: 0 0 4px; font-size: 18px; color: var(--muted); }
.result[data-verdict="eligible"] .verdict { color: var(--ok); }
.result[data-verdict="disputable"] .verdict { color: var(--warn); }
.amount { font-size: 44px; font-weight: 800; margin: 0; line-height: 1.1; }
.meta { color: var(--muted); font-size: 13.5px; margin: 4px 0 0; }
.note { color: var(--muted); font-size: 14.5px; margin: 8px 0 0; }
.claim {
  display: block; text-align: center; margin: 16px 0 8px; padding: 13px; border-radius: 14px;
  background: var(--accent); color: #fff; font-weight: 600; text-decoration: none;
}
.fine { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; }
/* Пометка «Реклама» у партнёрской кнопки: её должно быть видно, не спрятать в подвал. */
.fine.ad { font-weight: 600; }

.about ul { padding-left: 20px; }
.about li { margin-bottom: 6px; }
.app { color: var(--accent); font-weight: 600; text-decoration: none; }
footer { margin-top: 40px; color: var(--muted); font-size: 13.5px; border-top: 1px solid var(--border); padding-top: 16px; }
footer a { color: var(--muted); }
.langs a { margin-right: 10px; white-space: nowrap; }

h3 { font-size: 17px; margin: 20px 0 6px; }
.about ol { padding-left: 22px; }
.about ol li { margin-bottom: 6px; }
.about .note { color: var(--muted); font-size: 14.5px; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.tabs a, .tabs span {
  font-size: 14px; padding: 6px 12px; border-radius: 999px; text-decoration: none;
  border: 1px solid var(--border); color: var(--text);
}
.tabs span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }

.amounts { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 15px; }
.amounts th, .amounts td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.amounts thead th { font-size: 13px; color: var(--muted); font-weight: 600; }
.amounts tbody th { font-weight: 400; }
.amounts td { font-weight: 700; white-space: nowrap; }

details { border: 1px solid var(--border); border-radius: 12px; padding: 0 14px; margin-bottom: 8px; background: var(--surface); }
summary { cursor: pointer; font-weight: 600; padding: 12px 0; list-style-position: outside; }
details p { margin: 0 0 12px; color: var(--muted); }
.more a { color: var(--accent); text-decoration: none; }
.facts { margin: -12px 0 18px; font-size: 13.5px; color: var(--muted); }
.airlines { display: flex; flex-wrap: wrap; gap: 6px; }
.airlines a {
  font-size: 14px; padding: 5px 11px; border-radius: 999px; text-decoration: none;
  border: 1px solid var(--border); color: var(--text); background: var(--surface);
}

/* --- Ответ — посадочный талон --- */
.ticket { background: var(--ticket); position: relative; box-shadow: 0 6px 20px rgba(20,40,90,.08); }
.ticket-route { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.ticket-route b { display: block; font-size: 26px; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.ticket-route small { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-route .to { text-align: right; }
.ticket-plane { width: 28px; height: 28px; fill: var(--accent); transform: rotate(90deg); }
.perforation { position: relative; border-top: 2px dashed var(--border); margin: 14px -16px 14px; }
.perforation::before, .perforation::after {
  content: ""; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--border);
}
.perforation::before { left: -11px; clip-path: inset(0 0 0 50%); }
.perforation::after { right: -11px; clip-path: inset(0 50% 0 0); }

/* --- Письмо авиакомпании --- */
.btn {
  display: inline-block; font: inherit; font-weight: 600; font-size: 15px; padding: 11px 16px; border-radius: 12px;
  border: 1px solid var(--accent); background: var(--accent); color: #fff; text-decoration: none; cursor: pointer; text-align: center;
}
.btn.ghost { background: transparent; color: var(--accent); }
.btn.wide { display: block; width: 100%; margin: 4px 0 8px; }
.letter[hidden] { display: none; }
.letter-intro { margin: 0 0 12px; color: var(--muted); font-size: 14.5px; }
.letter-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.lf { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); min-width: 0; }
.lf input, .lf select {
  font: inherit; font-size: 15px; padding: 10px 11px; border-radius: 10px; min-width: 0;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
#l-text {
  width: 100%; font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 12px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); resize: vertical;
}
.letter-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.letter-example {
  white-space: pre-wrap; font: 14px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; overflow-x: auto;
}

/* --- Приложение под ответом --- */
.promo { display: flex; gap: 14px; align-items: flex-start; background: var(--accent-soft); border-color: transparent; }
.promo[hidden] { display: none; }
.promo-plane { flex: none; width: 30px; height: 30px; fill: var(--accent); transform: rotate(45deg); margin-top: 2px; }
.promo-title { margin: 0 0 2px; font-weight: 700; }
.promo-text { margin: 0 0 10px; color: var(--muted); font-size: 14.5px; }

/* --- Рейсы по России: что положено и претензия --- */
.rights-list { list-style: none; padding: 0; margin: 6px 0 10px; display: grid; gap: 8px; }
.rights-list .right { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.rights-list .right b { display: block; }
.rights-list .right small { display: block; color: var(--muted); font-size: 13.5px; }
.rights-list .right em { display: block; font-style: normal; font-size: 13.5px; font-weight: 600; color: var(--muted); margin-top: 2px; }
.rights-list .right.due em { color: var(--ok); }
.rights-list.later .right { opacity: .75; }
.list-title { margin: 14px 0 0; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.refund { margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--ok); }
.refund b { color: var(--ok); }
.refund p { margin: 4px 0 0; font-size: 14.5px; }
.fine-row { display: flex; justify-content: space-between; gap: 12px; margin: 14px 0 0; font-size: 15px; }
.fine-row b { font-size: 20px; font-variant-numeric: tabular-nums; }
.q .check { margin: 6px 0; }
.check-lf { justify-content: flex-end; }
.check-lf .check { color: var(--text); min-height: 42px; }
.letter-form.one { grid-template-columns: 1fr; }
.totals { margin: 4px 0 12px; }
.totals caption { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding-bottom: 4px; }
.totals th small { display: block; color: var(--muted); font-size: 12.5px; }
.totals td { text-align: right; font-variant-numeric: tabular-nums; }
.totals .sum th, .totals .sum td { font-weight: 800; font-size: 17px; border-bottom: 0; }
.rules td { font-weight: 400; white-space: normal; }
.btn:disabled { opacity: .45; cursor: default; }

@media (max-width: 520px) {
  h1 { font-size: 25px; }
  .route { grid-template-columns: 1fr; }
  .swap { justify-self: end; width: 38px; height: 38px; margin: -4px 0; }
  .swap .h { display: none; }
  .swap .v { display: inline; }
  .badge img { height: 36px; }
  .letter-form { grid-template-columns: 1fr; }
  .hero .plane { width: 24px; height: 24px; left: calc(52% - 12px); top: 50px; }
}
