/* CallMy VPN — design tokens & base styles
   Inspired by BlancVPN: light surface, soft blue accent, large radii, calm shadows. */

:root {
  --bg:        #f4f6fb;
  --surface:   #ffffff;
  --surface-2: #f8fafc;
  --border:    #e5e9f2;
  --text:      #0f172a;
  --muted:     #64748b;
  --accent:    #2563eb;
  --accent-2:  #1d4ed8;
  --accent-soft:#eff4ff;
  --grad-from: #3b82f6;
  --grad-to:   #1d4ed8;
  --success:   #10b981;
  --danger:    #ef4444;
  --radius:    18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.05);
  --shadow:    0 4px 12px rgba(15,23,42,.06), 0 2px 4px rgba(15,23,42,.04);
  --font:      "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono:      "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root.theme-auto {
    --bg:        #0b0d10;
    --surface:   #11151b;
    --surface-2: #0e1217;
    --border:    #1f2630;
    --text:      #e7ebf2;
    --muted:     #8a93a3;
    --accent-soft:#162035;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow:    0 6px 20px rgba(0,0,0,.45);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header / sidebar ---------- */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 18px; margin-bottom: 28px;
}
.sidebar .brand .mark {
  width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(135deg, var(--grad-from), var(--grad-to));
}
.sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  color: var(--text);
}
.sidebar nav a:hover { background: var(--accent-soft); text-decoration: none; }
.sidebar nav a.active { background: var(--accent-soft); color: var(--accent); }

.main { padding: 32px 24px; }

/* ---------- Public header (landing) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: saturate(140%) blur(8px);
  background: rgba(244,246,251,.72);
  border-bottom: 1px solid var(--border);
}
.topbar .row {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.topbar .brand .mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--grad-from), var(--grad-to));
}
.topbar nav a { color: var(--text); margin-left: 18px; font-weight: 500; }
.topbar nav a:hover { color: var(--accent); text-decoration: none; }

/* ---------- Card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 16px; }
.card-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
}
.card-title { font-weight: 600; font-size: 18px; margin: 0 0 6px; }
.card-sub { color: var(--muted); margin: 0 0 14px; }

.card-hero {
  background: linear-gradient(135deg, var(--grad-from), var(--grad-to));
  color: #fff;
  border: none;
}
.card-hero .badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.18);
  padding: 4px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 500;
}

/* ---------- Icons ---------- */
.icon {
  width: 18px; height: 18px;
  display: inline-block;
  flex: 0 0 auto;
  color: currentColor;
  vertical-align: -3px;
}
.icon-lg { width: 22px; height: 22px; }
.icon-sm { width: 15px; height: 15px; vertical-align: -2px; }

/* Rounded gradient badge used for feature / platform icons */
.icon-badge {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--grad-from), var(--grad-to));
  color: #fff;
  box-shadow: 0 6px 16px rgba(37,99,235,.28);
}
.icon-badge .icon { width: 22px; height: 22px; }
.icon-badge-soft {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: none;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 11px 20px; border-radius: 14px;
  font-weight: 600; font-size: 14px; line-height: 1.1; letter-spacing: .01em;
  cursor: pointer; border: 1px solid transparent;
  transition: transform .18s cubic-bezier(.4,0,.2,1), box-shadow .18s ease,
              background .15s ease, color .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn .icon { width: 18px; height: 18px; }
.btn:active { transform: translateY(0) scale(.99); }

.btn-primary {
  background: linear-gradient(135deg, var(--grad-from), var(--grad-to));
  color: #fff;
  box-shadow: 0 4px 14px rgba(37,99,235,.32);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(37,99,235,.42);
  text-decoration: none;
}
.btn-ghost {
  background: var(--surface); color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover {
  background: var(--accent-soft); color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}
.btn-on-hero {
  background: #fff; color: var(--accent);
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.btn-on-hero:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,.24); }
.btn-lg { padding: 14px 26px; font-size: 15px; border-radius: 16px; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.field-label {
  display: block;
  font-size: 13px; font-weight: 500;
  color: var(--muted); margin-bottom: 6px;
}

/* ---------- Hero (landing) ---------- */
.hero {
  padding: 72px 0 56px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.05;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
}
.hero p {
  color: var(--muted);
  font-size: 18px;
  max-width: 640px;
  margin: 0 auto 28px;
}
.hero .cta { display: inline-flex; gap: 12px; }

/* ---------- Grids ---------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.grid-pricing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

/* ---------- Pricing card ---------- */
.plan { position: relative; }
.plan .price { font-size: 32px; font-weight: 700; margin: 8px 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.plan .price small { font-size: 14px; color: var(--muted); font-weight: 500; }
.old-price {
  font-size: 16px; font-weight: 500;
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--danger);
}
.plan.featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow);
}
.plan .ribbon {
  position: absolute; top: -10px; right: 16px;
  background: var(--accent); color: #fff;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}

/* ---------- FAQ ---------- */
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
}
.faq details + details { margin-top: 10px; }
.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq details[open] { background: var(--accent-soft); border-color: var(--accent); }
.faq p { margin: 10px 0 0; color: var(--muted); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  margin-top: 64px; padding: 36px 0 24px; color: var(--muted);
  font-size: 14px;
  background: var(--surface);
}
.footer .row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.4fr 1.4fr;
  gap: 32px;
  padding-bottom: 24px;
}
.footer-brand { font-weight: 700; color: var(--text); font-size: 16px; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-title {
  font-weight: 600; color: var(--text);
  text-transform: uppercase; font-size: 12px; letter-spacing: .06em;
  margin-bottom: 4px;
}
.footer-col a { color: var(--muted); }
.footer-col a:hover { color: var(--accent); text-decoration: none; }
.footer-bottom { padding-top: 18px; border-top: 1px solid var(--border); font-size: 13px; }

@media (max-width: 720px) {
  .footer-cols { grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (max-width: 460px) {
  .footer-cols { grid-template-columns: 1fr; }
}

/* ---------- Data tables (ref stats) ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th,
.data-table td {
  padding: 12px 18px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table th {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  background: var(--surface-2);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--accent-soft); }
.data-table td.num,
.data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Status chips ---------- */
.chip {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.4;
}
.chip-ok      { background: #d1fae5; color: #047857; }
.chip-pending { background: #fef3c7; color: #92400e; }
.chip-bad     { background: #fee2e2; color: #b91c1c; }
.chip-mute    { background: var(--surface-2); color: var(--muted); }
.chip-wow     {
  background: linear-gradient(135deg, var(--grad-from), var(--grad-to));
  color: #fff;
  margin-left: 6px;
  box-shadow: 0 2px 8px rgba(37,99,235,.35);
}

/* ---------- Legal pages (privacy/terms) ---------- */
.legal h2 { margin-top: 28px; }
.legal p, .legal li { line-height: 1.6; }
.legal ul { padding-left: 22px; }
.legal a { color: var(--accent); }

/* ---------- Utilities ---------- */
.muted { color: var(--muted); }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }
.h2 { font-size: 28px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 16px; }
.h3 { font-size: 20px; font-weight: 600; margin: 0 0 12px; }
.hstack { display: flex; align-items: center; gap: 10px; }
.vstack { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Install list (download page) ---------- */
.install-list { display: flex; flex-direction: column; gap: 12px; }
.install-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.install-name { font-weight: 600; font-size: 16px; }

/* ---------- Menu list (profile) ---------- */
.menu-list { gap: 4px; }
.menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 12px; border-radius: 12px;
  color: var(--text);
}
.menu-item:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.menu-item span { flex: 1; }
.menu-item .chev { color: var(--muted); }

/* ---------- Mobile ---------- */
@media (max-width: 880px) {
  /* Cabinet: sidebar becomes a sticky scrollable top icon-nav */
  .app-shell { display: block; }
  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
    position: sticky; top: 0; z-index: 20;
    background: var(--surface);
  }
  .sidebar .brand { margin-bottom: 10px; font-size: 16px; }
  .sidebar nav {
    flex-direction: row;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .sidebar nav::-webkit-scrollbar { display: none; }
  .sidebar nav a {
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    font-size: 11px;
    white-space: nowrap;
  }
  .main { padding: 16px; }
}

@media (max-width: 720px) {
  body { font-size: 14px; }
  .container, .container-narrow { padding: 0 16px; }
  /* Topbar: keep brand + login, hide section links */
  .topbar nav a:not(.btn) { display: none; }
  .topbar nav a.btn { margin-left: 0; }
  .hero { padding: 44px 0 32px; }
  .hero p { font-size: 16px; }
  .hero .cta { flex-direction: column; align-items: stretch; gap: 10px; }
  .hero .cta .btn { width: 100%; }
  .footer .row { flex-direction: column; gap: 10px; }
}

@media (max-width: 560px) {
  /* Stack any label+action card rows */
  .card-row { grid-template-columns: 1fr; align-items: start; }
  .card-row .btn { width: 100%; }
  /* Install rows: icon+text on top, button full width below */
  .install-row { grid-template-columns: auto 1fr; }
  .install-row .btn { grid-column: 1 / -1; width: 100%; }
  /* Ref link input + copy button stack */
  .hstack-wrap { flex-wrap: wrap; }
  .hstack-wrap .input { flex: 1 1 100%; }
  .hstack-wrap .btn { width: 100%; }
}
