/* GURG VPN мини-приложение. Стиль Family: кремовый фон, пастельные карточки, кнопки-таблетки. */
:root {
  --bg: #fbf9f1;
  --panel: #ffffff;
  --ink: #24182f;
  --muted: #5b5266;
  --hairline: #e6dfd0;
  --soft: #f1ece2;
  --focus: #4a1d6b;
  --night: #1b2331;
  --on-night: #f7f3e8;
  --lilac: #c3b1e6;   --on-lilac: #4a1d6b;
  --pink: #f4849f;    --on-pink: #5a1440;
  --sage: #c5d98a;    --on-sage: #2c4410;
  --butter: #fddc6c;  --on-butter: #4a3408;
  --peach: #f6a46e;   --on-peach: #5a2a08;
  --sky: #b9cfe4;     --on-sky: #1d3556;
  --shadow: 0 12px 32px rgba(36, 24, 47, 0.14);
  --serif: "Lora", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, sans-serif;
}
html.dark {
  --bg: #17151c;
  --panel: #221f2a;
  --ink: #f5f0e6;
  --muted: #b9b0c4;
  --hairline: #3a3544;
  --soft: #2d2936;
  --focus: #c3b1e6;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: none; background: none; cursor: pointer; margin: 0; padding: 0; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button:disabled { opacity: 0.55; cursor: default; }
.tap { transition: transform 0.12s cubic-bezier(.3,1.6,.6,1); }
.tap:active:not(:disabled) { transform: scale(0.97); }

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100vh;
}

.serif { font-family: var(--serif); font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13px; line-height: 18px; }
.xs { font-size: 12px; line-height: 16px; }

/* Шапка */
.top { display: flex; align-items: center; gap: 12px; }
.top .logo { width: 44px; height: 44px; border-radius: 14px; display: block; }
.top .grow { display: flex; flex-direction: column; flex-grow: 1; min-width: 0; }
.top .title { font-family: var(--serif); font-size: 22px; line-height: 26px; font-weight: 700; }
.top .h1 { font-family: var(--serif); font-size: 28px; line-height: 32px; font-weight: 700; }
.round {
  width: 44px; height: 44px; border-radius: 999px; background: var(--panel);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* Карточки */
.card { border-radius: 40px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.card.big { padding: 28px; gap: 18px; }
.lilac { background: var(--lilac); color: var(--on-lilac); }
.pink { background: var(--pink); color: var(--on-pink); }
.sage { background: var(--sage); color: var(--on-sage); }
.butter { background: var(--butter); color: var(--on-butter); }
.peach { background: var(--peach); color: var(--on-peach); }
.sky { background: var(--sky); color: var(--on-sky); }
.night { background: var(--night); color: var(--on-night); }
.panel {
  background: var(--panel); color: var(--ink); border-radius: 20px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.lilac .panel, .pink .panel, .sage .panel, .butter .panel, .peach .panel, .sky .panel {
  background: #ffffff; color: #24182f;
}
.lilac .panel .muted, .sage .panel .muted, .butter .panel .muted, .peach .panel .muted, .sky .panel .muted { color: #5b5266; }
.float { box-shadow: var(--shadow); }
.card-title { font-family: var(--serif); font-size: 22px; line-height: 26px; font-weight: 700; }

.chip {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  background: rgba(255,255,255,0.55); border-radius: 999px; padding: 6px 12px;
  font-size: 13px; line-height: 18px; font-weight: 600;
}
.dot { width: 8px; height: 8px; border-radius: 999px; background: currentColor; display: block; }
.big-num { font-family: var(--serif); font-size: 56px; line-height: 60px; font-weight: 700; letter-spacing: -1px; }

.bar { height: 8px; border-radius: 999px; background: #e6dfd0; overflow: hidden; }
.bar > div { height: 8px; border-radius: 999px; background: #2c4410; }

/* Кнопки */
.btn {
  min-height: 56px; border-radius: 999px; padding: 0 20px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 16px; font-weight: 700; text-align: center; width: 100%;
}
.btn.xl { min-height: 60px; font-size: 17px; }
.btn.sm { min-height: 48px; font-size: 15px; font-weight: 600; }
.btn.primary { background: var(--night); color: var(--on-night); }
html.dark .btn.primary.on-bg { background: var(--lilac); color: var(--on-lilac); }
.btn.ghost { background: rgba(255,255,255,0.55); }
.btn.outline { background: transparent; border: 2px solid #5b6577; color: var(--on-night); }
.btn.sage-fill { background: var(--sage); color: var(--on-sage); }
.btn.cta {
  min-height: 64px; padding: 0 8px 0 24px; justify-content: space-between;
  background: var(--butter); color: var(--on-butter); box-shadow: var(--shadow); font-size: 17px;
}
.btn.cta .pill {
  height: 48px; padding: 0 18px; border-radius: 999px; background: var(--on-butter); color: var(--butter);
  display: flex; align-items: center; gap: 6px; font-size: 16px;
}
.pill-sm {
  height: 36px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center;
  font-size: 13px; font-weight: 700; white-space: nowrap; flex-shrink: 0;
}

/* Бенто-плитки */
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile {
  border-radius: 32px; padding: 20px; min-height: 140px;
  display: flex; flex-direction: column; justify-content: space-between; text-align: left;
}
.tile .t { font-family: var(--serif); font-size: 22px; line-height: 26px; font-weight: 700; }
.tile .d { font-size: 14px; line-height: 20px; }
.mini {
  border-radius: 28px; padding: 16px 12px; display: flex; flex-direction: column; gap: 6px;
  align-items: center; text-align: center; font-size: 13px; line-height: 17px; font-weight: 700;
}

/* Шаги подключения */
.step-head { display: flex; align-items: center; gap: 12px; }
.step-num {
  width: 32px; height: 32px; border-radius: 999px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; flex-shrink: 0;
}
.lilac .step-num { background: var(--on-lilac); color: var(--lilac); }
.butter .step-num { background: var(--on-butter); color: var(--butter); }
.sage .step-num { background: var(--on-sage); color: var(--sage); }
.seg { height: 48px; border-radius: 999px; font-size: 15px; font-weight: 600; background: rgba(255,255,255,0.55); }
.seg[aria-pressed="true"] { background: var(--on-lilac); color: #ffffff; }
.app-row {
  background: #ffffff; color: #24182f; border-radius: 20px; padding: 12px;
  display: flex; align-items: center; gap: 12px; outline: 2px solid transparent;
}
.app-row.on { outline-color: var(--on-butter); box-shadow: var(--shadow); }
.app-row .pick { flex-grow: 1; display: flex; align-items: center; gap: 12px; text-align: left; min-width: 0; }
.app-icon {
  width: 44px; height: 44px; border-radius: 12px; background: var(--night); color: var(--on-night);
  display: flex; align-items: center; justify-content: center; font-family: var(--serif);
  font-weight: 700; font-size: 20px; flex-shrink: 0; overflow: hidden;
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; }

/* Тарифы */
.feat { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.feat div { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 20px; font-weight: 500; }
.feat svg { flex-shrink: 0; margin-top: 1px; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 44px; height: 44px; border-radius: 999px; font-size: 22px; font-weight: 600; }
.stepper .minus { background: #f1ece2; color: #24182f; }
.stepper .plus { background: var(--night); color: var(--on-night); }
.stepper .n { width: 36px; text-align: center; font-family: var(--serif); font-size: 24px; font-weight: 700; }
.period {
  background: var(--panel); color: var(--ink); border-radius: 28px; padding: 18px 20px;
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  outline: 2px solid transparent;
}
.period.on { outline-color: var(--on-lilac); box-shadow: var(--shadow); }
html.dark .period.on { outline-color: var(--lilac); }
.radio {
  width: 22px; height: 22px; border-radius: 999px; border: 2px solid currentColor;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.radio span { width: 10px; height: 10px; border-radius: 999px; background: transparent; display: block; }
.period.on .radio span { background: currentColor; }
.sale { background: var(--butter); color: var(--on-butter); border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; line-height: 16px; }
.price { font-family: var(--serif); font-size: 22px; font-weight: 700; white-space: nowrap; }

/* Устройства */
.device {
  background: #ffffff; color: #24182f; border-radius: 20px; padding: 12px 12px 12px 16px;
  display: flex; align-items: center; gap: 12px;
}
.device .info { display: flex; flex-direction: column; flex-grow: 1; min-width: 0; }
.device .name { font-size: 15px; line-height: 20px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.del { background: #f1ece2; color: #5a1440; }

.link-row { display: flex; align-items: center; gap: 10px; }
.link-row .url { flex-grow: 1; min-width: 0; font-size: 15px; line-height: 20px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Экран-лист (правила) */
.sheet { white-space: pre-wrap; font-size: 15px; line-height: 22px; }

/* Загрузка и ошибки */
.loading {
  min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  color: var(--muted); font-size: 15px;
}
.loading img { border-radius: 22px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }
.spin { width: 20px; height: 20px; border-radius: 999px; border: 3px solid currentColor; border-right-color: transparent; animation: rot 0.8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

#toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--night); color: var(--on-night); border-radius: 999px; padding: 12px 20px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow); max-width: calc(100% - 32px); text-align: center;
  z-index: 10;
}
@media (prefers-reduced-motion: reduce) {
  .tap, .loading img, .spin { transition: none; animation: none; }
}
