/* ═══════════════════════════════════════════
   EsoTerra pay — Design System v2.0
   Clean, maintainable, no !important
   ═══════════════════════════════════════════ */

/* ── Tokens ── */
:root {
  --bg: #0c0f13;
  --card: #12161c;
  --muted: #9aa3b2;
  --text: #e8ecf3;
  --accent1: #8b5cf6;
  --accent2: #6366f1;
  --accent3: #60a5fa;
  --radius: 16px;
  --shadow: 0 6px 20px rgba(0,0,0,.35);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
* { -webkit-tap-highlight-color: rgba(0,0,0,0); }
a { color: #b3c7ff; text-decoration: none; }
a:hover { text-decoration: none; }

/* ── Container ── */
.container { max-width: 1180px; margin: 0 auto; padding: 24px; }

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(12,15,19,.78);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.05);
  transform: translateZ(0);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 0;
  flex-wrap: wrap;
}

/* ── Brand ── */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.brand .logo { height: 32px; width: auto; display: block; image-rendering: auto; }
.brand-text { display: flex; flex-direction: column; gap: 2px; }
.brand-name { font-weight: 800; font-size: 24px; line-height: 1; }
.brand-tagline { font-size: 15px; line-height: 1.1; opacity: .9; }

/* ── Nav ── */
.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  flex: 1 1 auto;
  min-width: 0;
}
.nav a { white-space: nowrap; padding: 10px 14px; border-radius: 10px; }
.nav a:hover { background: rgba(255,255,255,.06); }

/* ── Language toggle button ── */
.lang-toggle {
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease;
  letter-spacing: .5px;
}
.lang-toggle:hover {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.25);
}
.lang-toggle:active { transform: scale(.97); }

/* ── Hero ── */
.hero {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 28px;
  align-items: center;
  margin-top: 12px;
}
.hero .panel {
  background: linear-gradient(180deg, #12161c, #0f1318);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.kicker {
  display: inline-block;
  background: rgba(139,92,246,.15);
  color: #d7c9ff;
  border: 1px solid rgba(139,92,246,.35);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  margin-bottom: 12px;
}
h1 { font-size: 42px; line-height: 1.15; margin: 6px 0 12px; }
.lead { color: #c8d2e2; font-size: 18px; margin-bottom: 14px; }
.badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.badge {
  font-size: 13px;
  color: #d7e0f3;
  border: 1px solid rgba(255,255,255,.1);
  background: #0f141a;
  padding: 8px 12px;
  border-radius: 999px;
}
.hero img { width: 100%; height: auto; border-radius: 18px; border: 1px solid rgba(255,255,255,.06); }

/* ── Sections ── */
.section { margin: 46px 0; }
.section h2 { font-size: 28px; margin: 0 0 18px; }

/* ── Services grid: 2 columns ── */
#programs .grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}

/* ── Cards ── */
.card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: 100%;
}
.card > img {
  display: block;
  width: 100%;
  height: 210px;
  object-fit: cover;
  filter: saturate(1.06) contrast(1.02);
}
.card .body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 18px 20px;
  flex: 1 1 auto;
}
.card h3 { margin: 0; font-size: 22px; line-height: 1.15; letter-spacing: .2px; }
.card p { margin: 0; color: #cbd5e1; }

.service-sub { color: #e5eefc; font-weight: 650; }
.service-text { color: #cbd5e1; line-height: 1.55; }
.service-meta { font-size: 14px; color: #9fb0c6; }

/* ── Service bullets (full card) ── */
.service-bullets {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 12px;
}
.service-bullets-title { font-weight: 750; color: #e5eefc; margin-bottom: 6px; }
ul.bullets { margin: 0 0 0 18px; padding: 0; color: #cbd5e1; }
ul.bullets li { margin: 6px 0; }

/* ── Card actions ── */
.card .actions {
  margin-top: auto;
  padding: 0;
  display: flex;
  justify-content: center;
  text-align: center;
}

/* ── Buttons ── */
.btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--accent2), var(--accent3));
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(96,165,250,.35);
  user-select: none;
  touch-action: manipulation;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .2s ease, filter .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active {
  transform: translateY(1px);
  box-shadow: 0 8px 24px rgba(38,99,255,.35), 0 0 0 1px rgba(255,255,255,.06) inset;
  filter: saturate(1.1);
}
.btn:focus { outline: none; box-shadow: 0 0 0 3px rgba(99,102,241,.35); }

/* ── Pay button ── */
.btn.pay {
  width: 100%;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  font-weight: 850;
  font-size: 17px;
  text-decoration: none;
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  box-shadow: 0 12px 24px rgba(96,165,250,.22);
}
.btn.pay:hover { transform: translateY(-1px); filter: saturate(1.08); }
.btn.pay:active { transform: translateY(0); }

/* ── Full-width card (package) ── */
.card.card--full { grid-column: 1 / -1; position: relative; }
.card.card--full::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 24px;
  background: linear-gradient(135deg, #8b5cf6, #6366f1, #60a5fa);
  z-index: 0;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  padding: 2px;
}
.card.card--full { background: var(--card); border: 1px solid rgba(167,139,250,.35); box-shadow: 0 18px 40px rgba(167,139,250,.16); }
.card.card--full .body,
.card.card--full > img,
.card.card--full .actions { position: relative; z-index: 1; }
.card.card--full .btn.pay {
  background: linear-gradient(135deg, #22c55e, #06b6d4);
  box-shadow: 0 10px 26px rgba(6,182,212,.35);
  font-size: 18px;
  padding: 16px 30px;
  min-width: 200px;
  background-size: 200% 200%;
  background-position: 0% 50%;
  transition: transform .08s ease, background-position .4s ease, filter .4s ease;
}
.card.card--full .btn.pay:hover { background-position: 100% 50%; filter: brightness(1.06); }
.card.card--full .btn.pay:active { transform: translateY(1px); }

/* ── How it works + Benefits ── */
.how-benefits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.steps, .benefits {
  background: linear-gradient(180deg, #11161d, #0e1217);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 18px;
  padding: 18px 22px;
  box-shadow: var(--shadow);
}
.steps ol { margin: 8px 0 0 18px; padding: 0; }
.steps li { margin: 8px 0; }
.benefits ul { margin: 10px 0 0 18px; padding: 0; }
.benefits li { margin: 8px 0; }

/* ── Help checklist ── */
.help-block { margin-top: 18px; }
.help-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; list-style: none; padding: 0; margin: 0; }
.help-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  padding: 10px 12px;
  border-radius: 12px;
}
.help-item::before {
  content: "✓";
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(99,102,241,.5);
}
.help-item span { font-size: 15px; line-height: 1.45; }

/* ── FAQ ── */
.faq .item { border-top: 1px solid rgba(255,255,255,.08); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 0;
  font-weight: 700;
}
.faq summary::-webkit-details-marker { display: none; }
.faq details .answer { color: #cbd5e1; padding: 0 0 16px; }

/* ── Footer ── */
.footer { margin-top: 48px; border-top: 1px solid rgba(255,255,255,.08); }
.footer-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  color: #a9b6c8;
}
.footer-inner img { height: 24px; }
.footer-contacts { display: flex; flex-direction: column; gap: 6px; }
.footer-link { color: #cfe6ff; text-decoration: none; }
.footer-link:hover { text-decoration: underline; }
.footer-links { margin-left: auto; display: flex; gap: 16px; flex-wrap: wrap; }
.small { font-size: 13px; color: #9fb0c6; }

/* ── Payment system code ── */
.payment-system-code {
  padding: 0 24px 16px;
  text-align: center;
  word-break: break-all;
  color: #7f8fa6;
  font-size: 12px;
}

/* ── Cookie banner ── */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1000;
  background: rgba(13, 17, 23, .96);
  color: #fff;
  padding: 12px 0;
  font-size: 14px;
  display: none;
}
.cookie-banner-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cookie-text { flex: 1 1 260px; margin: 0; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cookie-actions .btn {
  border-radius: 999px;
  padding: 6px 16px;
  border: 1px solid rgba(255,255,255,.18);
  cursor: pointer;
  font-size: 14px;
}
.cookie-actions .btn.primary { background: #f4c15a; color: #141414; border-color: #f4c15a; }
.cookie-actions .btn.secondary { background: transparent; color: #fff; }
.cookie-banner a { color: #f4c15a; text-decoration: underline; }

/* ── Consent modal ── */
body.modal-open { overflow: hidden; }
.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,.62);
  z-index: 2001;
}
.modal-overlay.open { display: flex; }
.modal {
  width: min(560px, 100%);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(18,22,28,.98), rgba(12,15,19,.98));
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 24px 70px rgba(0,0,0,.55);
  padding: 18px 18px 16px;
}
.modal-title { margin: 0 0 10px; font-size: 18px; font-weight: 800; letter-spacing: .2px; }
.modal-text { margin: 0 0 14px; color: #cbd5e1; line-height: 1.55; }
.modal-text a { color: #cfe6ff; text-decoration: underline; }
.modal-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  margin-bottom: 14px;
}
.modal-check input { margin-top: 3px; width: 18px; height: 18px; }
.modal-check span { color: #e8ecf3; line-height: 1.45; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.modal-actions .btn { box-shadow: none; padding: 12px 18px; border-radius: 12px; }
.modal-actions .btn.secondary {
  background: transparent;
  border: 1px solid rgba(255,255,255,.16);
  color: #e8ecf3;
}
.modal-actions .btn.secondary:hover { background: rgba(255,255,255,.06); }
.modal-actions .btn.primary {
  background: linear-gradient(135deg, var(--accent2), var(--accent3));
  border: 0;
  color: #fff;
}
.modal-actions .btn.primary:disabled { opacity: .45; cursor: not-allowed; filter: saturate(.7); }

/* ── Legal pages ── */
main.legal { max-width: 960px; margin: 0 auto 64px; font-size: 15px; line-height: 1.7; }
main.legal h1 { font-size: 26px; margin-bottom: 4px; font-weight: 600; }
main.legal .legal-meta { margin-top: 0; margin-bottom: 20px; font-size: 13px; opacity: .7; }
main.legal h2 { margin-top: 24px; margin-bottom: 8px; font-size: 18px; font-weight: 600; }
main.legal p { margin: 0 0 8px; }
main.legal ul { margin: 0 0 12px 18px; padding-left: 16px; }
main.legal li { margin-bottom: 4px; }
.legal ul { margin: 10px 0 0 18px; padding: 0; }
.legal li { margin: 8px 0; color: #cbd5e1; }

/* ── Pricing misc ── */
.price { margin: 8px 0 0; color: #fff; font-weight: 700; }
.defs { margin: 10px 0 0; padding: 0; }
.defs dt { margin-top: 10px; font-weight: 700; color: #fff; }
.defs dd { margin: 6px 0 0 0; color: #cbd5e1; }

/* ═══ Grid for services page (non-#programs) ═══ */
.section .grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  align-items: stretch;
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .how-benefits { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  #programs .grid,
  .section .grid { grid-template-columns: 1fr; }
  .card.card--full { grid-column: auto; }
  .help-list { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .container { padding: 16px; }
  .header-inner { gap: 10px; padding: 10px 0; }
  .brand .logo { height: 26px; }
  .brand-text { gap: 0; }
  .brand-name { font-size: 18px; line-height: 1.1; }
  .brand-tagline { display: none; }

  .nav {
    gap: 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 8px 10px; }

  .hero { gap: 16px; margin-top: 8px; }
  .hero .panel { padding: 14px; }

  h1 { font-size: 32px; }

  .card > img { height: 200px; }
  .btn { padding: 10px 14px; font-size: 14px; }
  .btn.pay { font-size: 16px; padding: 13px 22px; min-width: 160px; }
  .card.card--full .btn.pay { font-size: 17px; padding: 14px 24px; min-width: 180px; }

  .cookie-banner-inner { flex-direction: column; align-items: flex-start; }
  .modal { padding: 16px 14px 14px; }
  .modal-actions { justify-content: stretch; }
  .modal-actions .btn { flex: 1 1 auto; }
}

/* ── Safari / iOS fixes ── */
@supports (-webkit-touch-callout: none) {
  .card h3, .card p { -webkit-box-orient: vertical; }
}
