/* ========== CSS VARIABLES ========== */
:root{
  --bg: #0e1114;
  --bg-2:#101418;
  --panel:#12171c;
  --panel-2:#151b21;
  --border:#1f2a33;
  --text:#eef2f6;
  --muted:#a7b0b8;
  --muted-2:#8b96a0;
  --accent:#22c55e;      /* дозированный зелёный */
  --accent-2:#4ade80;
  --shadow:0 6px 24px rgba(0,0,0,.35);
  --radius:14px;
  --radius-lg:18px;
  --gap:14px;
  --gap-lg:20px;
  --focus:0 0 0 2px rgba(34,197,94,.35);
  --trans: 160ms ease;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji","Segoe UI Emoji";
}

/* ========== RESET ========== */
*{box-sizing:border-box}
html,body{height:100%}
html{color-scheme:dark}
body{
  margin:0;
  background:
    radial-gradient(circle at 10% 20%, rgba(34,197,94,.17), transparent 40%),
    radial-gradient(circle at 80% 0%, rgba(14,165,233,.25), transparent 45%),
    #05070c;
  color:var(--text);
  font-family: var(--font);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  line-height:1.45;
}

/* Фиксированный верхний градиент, который не "едет" при скролле */
body::before{
  content:"";
  position:fixed;
  inset:0 0 auto 0;
  height:180px;
  pointer-events:none;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(34,197,94,.25), transparent 60%),
    radial-gradient(120% 120% at 100% 0%, rgba(34,197,94,.18), transparent 60%);
  z-index:0;
}

/* ========== APP LAYOUT ========== */
.app{min-height:100%; display:flex; flex-direction:column; position:relative; z-index:1; max-width:1080px; margin:0 auto; padding-bottom:60px;}
.app-header{
  padding:18px 16px 10px;
  position:sticky; top:0; z-index:5;
  background:linear-gradient(to bottom, rgba(16,20,24,.9), rgba(16,20,24,.75) 60%, rgba(16,20,24,.4) 100%);
  backdrop-filter:saturate(120%) blur(6px);
  border-bottom:1px solid rgba(255,255,255,.04);
}
.brand{display:flex; align-items:center; gap:12px; margin-bottom:10px}
.brand-logo{width:36px; height:36px; border-radius:10px; background:
  radial-gradient(120% 120% at 0% 0%, var(--accent-2), var(--accent)); box-shadow:0 0 0 4px rgba(34,197,94,.12) inset;}
.brand-title{display:flex; flex-direction:column; line-height:1.05}
.brand-line-1{font-weight:800; letter-spacing:2px; font-size:1.35rem; text-transform:uppercase;}
.brand-line-2{font-weight:300; letter-spacing:1.5px; font-size:0.85rem; text-transform:none; text-indent:1px; opacity:.8}
.neon-text{
  color: #d3ffec;
  text-shadow:
    0 0 6px rgba(34,197,94,.5),
    0 0 20px rgba(14,165,233,.35),
    0 0 30px rgba(14,165,233,.25),
    0 0 40px rgba(34,197,94,.2);
}
.thin-text{
  font-family: "Playfair Display", "Cormorant Garamond", "Times New Roman", serif;
  font-weight:200;
  letter-spacing:1px;
  color:#9cd5ff;
  margin-top:4px;
}

.steps{display:flex; align-items:center; gap:8px; flex-wrap:wrap}
.step{
  appearance:none; border:1px solid var(--border); background:var(--panel);
  color:var(--text); border-radius:999px; padding:7px 12px; font-size:12.5px;
  transition:all var(--trans);
}
.step[aria-current="step"]{border-color:rgba(34,197,94,.45); background:linear-gradient(180deg, rgba(34,197,94,.14), rgba(34,197,94,.04));}
.step:disabled{opacity:.6}
.step-index{opacity:.9; margin-right:4px}

.search-row{display:flex; gap:10px; margin-top:12px}
.input{
  width:100%; background:var(--panel); border:1px solid var(--border);
  border-radius:12px; padding:12px 12px; color:var(--text);
  outline:0; transition: box-shadow var(--trans), border-color var(--trans);
}
.input:focus{box-shadow:var(--focus); border-color:rgba(34,197,94,.4)}
.btn{
  appearance:none; border:1px solid transparent; border-radius:12px;
  padding:10px 14px; font-weight:600; cursor:pointer; transition:all var(--trans);
}
.btn.solid{background:var(--accent); color:#062410;}
.btn.solid:hover{filter:brightness(1.05)}
.btn.ghost{background:transparent; border-color:var(--border); color:var(--text)}
.btn.ghost:hover{border-color:#2a3641}
.btn.small{padding:7px 10px; font-size:12.5px}
.btn.sm{padding:7px 12px; font-size:13px}
.btn.xl{padding:14px 16px; font-size:16px; border-radius:14px}
.btn.icon{width:36px; height:36px; display:grid; place-items:center; font-size:18px}
.btn:focus-visible{outline:0; box-shadow:var(--focus)}

.app-main{flex:1; padding:14px 18px 120px; width:100%;}

/* ========== TYPOGRAPHY ========== */
.h2{font-size:18px; font-weight:700; margin:14px 2px 10px}
.h3{font-size:16px; font-weight:700; margin:8px 2px}
.muted{color:var(--muted)}
.small{font-size:12.5px}
.mt{margin-top:12px}
.mt-lg{margin-top:18px}
.ml-auto{margin-left:auto}
.price{font-weight:800}

/* ========== SCREENS ========== */
.screen{display:none; animation:fade .16s ease}
.screen.is-visible{display:block}
@keyframes fade{from{opacity:.85; transform:translateY(2px)} to{opacity:1; transform:none}}

.country-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap:16px;
}
.country-card{
  position:relative;
  display:flex; align-items:center; gap:12px;
  border-radius:var(--radius);
  padding:14px; overflow:hidden;
  background: linear-gradient(180deg, rgba(16,23,30,0.9), rgba(8,12,18,0.95));
  border:1px solid rgba(255,255,255,0.07);
  box-shadow:0 20px 45px rgba(3,9,15,.45);
  transition: transform var(--trans), border-color var(--trans), box-shadow var(--trans);
}
.country-card::after{
  content:"";
  position:absolute;
  inset:0;
  background:radial-gradient(circle at 20% -10%, rgba(34,197,94,.25), transparent 45%);
  opacity:0;
  transition:opacity var(--trans);
  pointer-events:none;
}
.country-card:hover{
  transform:translateY(-4px);
  border-color:rgba(34,197,94,.45);
  box-shadow:0 30px 60px rgba(0,0,0,.5);
}
.country-card:hover::after{opacity:1}
.country-card .flag{font-size:22px; width:28px}
.country-card .title{flex:1; min-width:0}
.country-name{margin:0 0 4px 0; font-size:15.5px; font-weight:700}
.country-card .meta{display:flex; gap:8px; align-items:center; color:var(--muted); font-size:12.8px}
.country-card .dot{opacity:.45}
.coverage{padding:2px 8px; border-radius:999px; border:1px solid var(--border); background:#0f1419}
.minprice{font-weight:700; color:#e7f7ed}

/* ========== COUNTRY HEADER (в тарифах) ========== */
.country-head{
  display:flex; align-items:center; gap:12px;
  background:linear-gradient(180deg, var(--panel), var(--panel-2));
  border:1px solid var(--border); border-radius:var(--radius);
  padding:10px 12px; margin-top:8px; margin-bottom:8px;
}
.country-flag{width:28px; height:28px; display:grid; place-items:center; font-size:22px}

/* ========== TARIFF LIST (страница, не попап) ========== */
.tariff-list{display:flex; flex-direction:column; gap:8px; margin-top:6px}
.tariff-row{
  display:grid; grid-template-columns: 1fr auto auto; align-items:center;
  background:linear-gradient(180deg, rgba(16,21,30,.92), rgba(10,12,14,.9));
  border:1px solid rgba(255,255,255,0.08);
  border-radius:calc(var(--radius) + 4px);
  padding:14px 16px; gap:12px;
  transition:transform var(--trans), border-color var(--trans), box-shadow var(--trans);
  cursor:pointer;
}
.tariff-row:hover {
  transform:translateY(-4px);
  border-color:rgba(34,197,94,.5);
  box-shadow:0 20px 45px rgba(0,0,0,.45);
}
 .tariff-row .action button {
   pointer-events:auto;
 }
.tariff-row .cell{display:flex; flex-direction:column}
.tariff-row .gb{font-size:16px; font-weight:800}
.tariff-row .price{font-size:16px; font-weight:800; min-width:120px; text-align:right; align-self:center}
.tariff-row .action{display:flex; justify-content:flex-end; align-items:center}

/* ========== ORDER ========== */
.order-summary{
  display:flex; flex-direction:column; gap:8px;
  background:linear-gradient(180deg, var(--panel), var(--panel-2));
  border:1px solid var(--border); border-radius:var(--radius);
  padding:12px;
}
.order-summary .row{display:flex; justify-content:space-between; align-items:center}

/* ========== FORMS ========== */
.field{display:flex; flex-direction:column; gap:6px; margin-top:12px}
.label{font-size:12.5px; color:var(--muted)}
select.input, .field select{
  width:100%; background:var(--panel); color:var(--text);
  border:1px solid var(--border); border-radius:12px; padding:11px 12px;
}
a{color:#d1e7db; text-decoration:none}
a:hover{text-decoration:underline}

.empty{
  display:none; margin:14px 2px; padding:16px; gap:10px;
  background:rgba(15,19,25,.85);
  border:1px dashed rgba(255,255,255,0.2);
  border-radius:14px;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
}
.empty button{
  margin-top:6px;
}
.screen[data-screen="home"] #emptyCountries{display:block}

/* ========== BOTTOM NAV ========== */
.bottom-nav{
  position:fixed; left:calc(50% - 520px); right:calc(50% - 520px); bottom:12px; z-index:6;
  display:flex; gap:10px; padding:12px; background:rgba(15,18,24,.75);
  border-radius:999px;
  border:1px solid rgba(255,255,255,.07);
  box-shadow:0 18px 40px rgba(0,0,0,.4);
}
.bottom-nav::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.08);
  pointer-events:none;
}
.bottom-nav .tab{
  border:none;
  background:transparent;
  flex:1;
  border-radius:999px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
  background:linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0));
}
.bottom-nav .tab.is-active{
  background:linear-gradient(180deg, rgba(34,197,94,.2), rgba(34,197,94,.1));
  border:1px solid rgba(34,197,94,.45);
}

@media (max-width: 1100px) {
  .bottom-nav {
    left:0;
    right:0;
    margin:0 12px;
  }
}
.tab{
  flex:1; border-radius:999px; padding:10px 14px; text-align:center;
  background:#0f1419; border:1px solid var(--border); color:var(--text); font-weight:700;
  transition:all var(--trans);
}
.tab.is-active{background:linear-gradient(180deg, rgba(34,197,94,.18), rgba(34,197,94,.06)); border-color:rgba(34,197,94,.45); color:#eafff3}

/* ========== SHEET (Квиз «Как выбрать») ========== */
.sheet{
  position:fixed; left:0; right:0; bottom:0; top:0; z-index:20;
  display:none; background:rgba(0,0,0,.3);
}
.sheet[aria-hidden="false"]{display:block}
.sheet-inner{
  position:absolute; left:0; right:0; bottom:0;
  background:var(--bg-2); border-top-left-radius:20px; border-top-right-radius:20px;
  box-shadow:0 -10px 30px rgba(0,0,0,.45); padding:14px;
  border-top:1px solid rgba(255,255,255,.06);
  max-height:80vh; overflow:auto;
}
.sheet-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:6px}
.advisor-form{display:flex; flex-direction:column; gap:10px}
.advisor-form .btn.xl{margin-top:6px}

/* ========== ACCESSIBILITY FOCUS HINTS ========== */
button:focus-visible, a:focus-visible, select:focus-visible{outline:0; box-shadow:var(--focus)}

/* ========== UTILITIES ========== */
.hidden{display:none !important}
