:root {
  --red: #d52b1e;
  --red-hover: #bd2418;
  --ink: #15171c;
  --muted: #5d6470;
  --line: #e5e6ea;
  --bg: #f6f5f2;
  --card: #ffffff;
  --blue: #0057b7;
  --yellow: #ffd500;
  --green: #1a8a45;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16,18,24,.04), 0 8px 30px rgba(16,18,24,.07);
  --shadow-lg: 0 2px 6px rgba(16,18,24,.05), 0 24px 60px rgba(16,18,24,.12);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); line-height: 1.55; -webkit-font-smoothing: antialiased; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; }
a { color: var(--red); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
[hidden] { display: none !important; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(246,245,242,.86); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.logo b { color: var(--red); }
.logo-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--red); flex: none; }
.logo-mark svg { width: 16px; height: 16px; }
.nav { display: flex; gap: 22px; margin-left: 12px; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: .95rem; }
.nav a:hover { color: var(--ink); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: #fff; }
.lang button { border: 0; background: none; padding: 5px 11px; border-radius: 999px; font: inherit; font-size: .8rem; font-weight: 700; color: var(--muted); cursor: pointer; }
.lang button.active { background: var(--ink); color: #fff; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 11px; padding: 11px 18px; font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none; transition: transform .12s, box-shadow .15s, background .15s, border-color .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 4px 14px rgba(213,43,30,.25); }
.btn-primary:hover { background: var(--red-hover); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #2a2d35; }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: #c7cad1; }
.btn-link { background: none; color: var(--muted); padding: 8px 10px; }
.btn-link:hover { color: var(--ink); }
.btn-lg { padding: 15px 26px; font-size: 1.05rem; border-radius: 13px; }
.btn-sm { padding: 7px 12px; font-size: .85rem; border-radius: 9px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* inputs */
label.field { display: block; font-size: .86rem; font-weight: 500; color: #333842; margin-top: 12px; }
.field input, .field select, .field textarea { display: block; width: 100%; margin-top: 5px; padding: 11px 13px; border: 1px solid #d6d9de; border-radius: 10px; font: inherit; font-size: 1rem; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(21,23,28,.08); }
.field textarea { resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

/* footer */
.footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: .9rem; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer nav { display: flex; gap: 18px; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* legal pages */
.legal { max-width: 760px; padding: 40px 20px 64px; }
.legal h1 { font-size: 2rem; }
.legal h2 { font-size: 1.2rem; margin-top: 28px; }
.legal .todo { background: #fff3cd; padding: 0 4px; border-radius: 3px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow-lg); opacity: 0; transition: opacity .2s, transform .2s; z-index: 100; pointer-events: none; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 860px) {
  .nav { display: none; }
}
@media (max-width: 560px) {
  .grid2 { grid-template-columns: 1fr; }
}

/* flags (emoji flags don't render on Windows) */
.flag { display: inline-block; width: 18px; height: 13px; border-radius: 3px; vertical-align: -2px; flex: none; }
.flag-ua { background: linear-gradient(#0057b7 50%, #ffd500 50%); }
.flag-ch { width: 14px; height: 14px; background: #d52b1e url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M13 6h6v7h7v6h-7v7h-6v-7H6v-6h7z' fill='white'/%3E%3C/svg%3E") center/100% no-repeat; }
.flag-lg { width: 24px; height: 24px; border-radius: 5px; }
.logo span b { color: var(--red); }

.foot-note { font-size: .8rem; color: var(--muted); margin: 14px auto 0; }

/* ===== plan cards (landing + editor) ===== */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch; }
.plan { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 26px 22px; display: flex; flex-direction: column; text-align: left; }
.plan.featured { border: 2px solid var(--ink); box-shadow: var(--shadow-lg); }
.plan .badge-pop { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--red); color: #fff; font-size: .75rem; font-weight: 700; padding: 4px 12px; border-radius: 99px; white-space: nowrap; }
.plan h3 { margin: 0; font-size: 1.15rem; }
.plan .pdesc { color: var(--muted); font-size: .9rem; margin: 4px 0 16px; min-height: 2.6em; }
.plan .pprice { display: flex; align-items: baseline; gap: 6px; margin-bottom: 18px; }
.plan .pprice b { font-size: 2.3rem; font-weight: 900; letter-spacing: -.03em; }
.plan .pprice span { color: var(--muted); font-weight: 600; font-size: .9rem; }
.plan ul { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 8px; font-size: .92rem; flex: 1; }
.plan li { padding-left: 26px; position: relative; }
.plan li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 18px; height: 18px; border-radius: 50%; background: #e3f4e9; color: var(--green); display: grid; place-items: center; font-size: .66rem; font-weight: 800; }
.plan .btn { width: 100%; }
.plan.is-current { opacity: .7; }
.center { text-align: center; }

/* ===== modal ===== */
.modal { position: fixed; inset: 0; z-index: 90; background: rgba(15,17,22,.55); display: grid; place-items: center; padding: 20px; overflow-y: auto; }
.modal-card { position: relative; background: var(--bg); border-radius: 22px; padding: 30px; width: min(560px, 100%); box-shadow: var(--shadow-lg); max-height: calc(100vh - 40px); overflow-y: auto; }
.modal-wide { width: min(980px, 100%); }
.modal-card h2 { margin: 0 0 6px; }
.modal-card > .muted { margin: 0 0 26px; }
.modal-x { position: absolute; top: 14px; right: 16px; border: 0; background: none; font-size: 1.7rem; line-height: 1; color: var(--muted); cursor: pointer; }
.acc-plan { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 16px 0; }
.acc-plan .row { display: flex; justify-content: space-between; gap: 10px; font-size: .92rem; padding: 3px 0; }
.acc-plan .btn { margin-top: 10px; }
.acc-docs { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.acc-docs li { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.acc-docs li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-docs small { color: var(--muted); }
@media (max-width: 860px) { .plans { grid-template-columns: 1fr; } .plan .pdesc { min-height: 0; } }

/* promo code */
.promo { margin: 18px auto 0; max-width: 420px; text-align: center; }
.promo summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: .92rem; list-style: none; }
.promo summary::-webkit-details-marker { display: none; }
.promo-row { display: flex; gap: 8px; margin-top: 10px; }
.promo-row input { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid #d6d9de; border-radius: 10px; font: inherit; text-transform: uppercase; letter-spacing: .04em; }
.promo-msg { font-size: .88rem; font-weight: 600; margin: 8px 0 0; min-height: 1.2em; }
.promo-msg.ok { color: var(--green); }
.promo-msg.err { color: var(--red); }
.pprice s { color: var(--muted); font-weight: 600; font-size: 1rem; margin-right: 4px; }
.pprice { flex-wrap: wrap; }
.pprice s { flex-basis: 100%; margin: 0 0 -4px; }
.pprice b { white-space: nowrap; }
