@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --ink: #0F1420;
  --surface: #171D2B;
  --surface-2: #1E2536;
  --border: #2A3247;
  --text: #E7EAF0;
  --text-muted: #8B93A7;
  --accent: #4FD1C5;
  --accent-dim: #3AA79D;
  --warn: #F0B429;
  --danger: #F0685A;
  --radius: 12px;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

:root[data-theme="light"] {
  --ink: #F5F7FA;
  --surface: #FFFFFF;
  --surface-2: #F0F2F6;
  --border: #DCE1EA;
  --text: #171B24;
  --text-muted: #667085;
  --accent: #1B9C90;
  --accent-dim: #167A71;
  --warn: #B5790A;
  --danger: #C4453A;
}

:root[data-theme="light"] .btn-primary { color: #FFFFFF; }
:root[data-theme="light"] .tunnel-node .dot { background: #FFFFFF; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0 0 1em; color: var(--text-muted); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--font-mono); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* --- Навигация --- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15,20,32,.85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-logo { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.nav-logo::before {
  content: ''; width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 12px var(--accent);
}
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { color: var(--text-muted); font-size: 14px; font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: var(--text); text-decoration: none; }
.nav-cta { display: flex; gap: 12px; align-items: center; }

.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px;
  background: transparent; border: 1px solid var(--border); color: var(--text-muted);
  cursor: pointer; transition: border-color .15s ease, color .15s ease;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

.password-field { position: relative; }
.password-field input { padding-right: 44px; }
.password-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; color: var(--text-muted); cursor: pointer; border-radius: 6px;
}
.password-toggle:hover { color: var(--accent); }
.password-toggle .icon-eye-off { display: none; }
.password-toggle.is-visible .icon-eye { display: none; }
.password-toggle.is-visible .icon-eye-off { display: block; }

/* --- Кнопки --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 8px; font-weight: 600; font-size: 14px;
  border: 1px solid transparent; cursor: pointer; font-family: var(--font-body);
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #06201D; }
.btn-primary:hover { background: #62DBD0; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(240,104,90,.4); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* --- Hero --- */
.hero { padding: 88px 0 64px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono);
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent);
  background: rgba(79,209,197,.1); border: 1px solid rgba(79,209,197,.25);
  padding: 5px 12px; border-radius: 100px; margin-bottom: 20px;
}
.hero h1 { font-size: 44px; letter-spacing: -.01em; }
.hero .lead { font-size: 17px; max-width: 46ch; }
.hero-actions { display: flex; gap: 14px; margin-top: 28px; }

.hero-logo-slot { display: flex; justify-content: center; margin-bottom: 16px; min-height: 0; }
.hero-logo { max-height: 64px; max-width: 220px; object-fit: contain; }

/* --- Signature: tunnel diagram --- */
.tunnel {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 28px; position: relative; overflow: hidden;
}
.tunnel-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tunnel-node {
  display: flex; flex-direction: column; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--text-muted);
  width: 84px; text-align: center;
}
.tunnel-node .dot { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.tunnel-line { flex: 1; height: 2px; background: linear-gradient(90deg, var(--border), var(--accent), var(--border)); position: relative; margin: 0 4px; }
.tunnel-line::after {
  content: ''; position: absolute; top: -3px; left: 0; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 10px var(--accent);
  animation: travel 2.4s linear infinite;
}
@keyframes travel { 0% { left: 0; } 100% { left: calc(100% - 8px); } }
.tunnel-status { margin-top: 22px; display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); border-top: 1px dashed var(--border); padding-top: 16px; }
.tunnel-status .value { color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .tunnel-line::after { animation: none; left: 45%; } }

/* --- Sections --- */
.section { padding: 64px 0; border-top: 1px solid var(--border); }
.section-head { max-width: 60ch; margin-bottom: 40px; }
.section-head .eyebrow { margin-bottom: 14px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.card h3 { font-size: 17px; margin-bottom: 8px; }
.card p { font-size: 14px; margin-bottom: 0; }
.card .icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: rgba(79,209,197,.1); color: var(--accent); margin-bottom: 16px; font-size: 18px; }

/* --- Pricing --- */
.plans-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.plan-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; }
.plan-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 20px 40px -20px rgba(79,209,197,.35); }
.plan-name { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.plan-price { font-family: var(--font-display); font-size: 36px; font-weight: 700; margin: 10px 0 4px; }
.plan-price span { font-size: 14px; color: var(--text-muted); font-weight: 500; }
.plan-desc { font-size: 13px; margin-bottom: 22px; min-height: 2.6em; }
.plan-card form { margin-top: auto; }

/* --- Forms --- */
.form-page { max-width: 420px; margin: 72px auto; padding: 0 24px; }
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  padding: 11px 13px; border-radius: 8px; font-size: 14px; font-family: var(--font-body);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: none; }
.contact-type { display: flex; gap: 8px; margin-bottom: 18px; }
.contact-type label {
  flex: 1; text-align: center; padding: 9px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; cursor: pointer; color: var(--text-muted);
}
.contact-type input { display: none; }
.contact-type input:checked + label,
.contact-type label:has(input:checked) { border-color: var(--accent); color: var(--accent); background: rgba(79,209,197,.08); }
.form-error { background: rgba(240,104,90,.1); border: 1px solid rgba(240,104,90,.3); color: var(--danger); font-size: 13px; padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.form-footer { text-align: center; font-size: 13px; margin-top: 18px; color: var(--text-muted); }

/* --- App shell (личный кабинет) --- */
.app-shell { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 64px); }
.sidebar { border-right: 1px solid var(--border); padding: 28px 16px; }
.sidebar a {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 8px;
  color: var(--text-muted); font-size: 14px; font-weight: 500; margin-bottom: 2px;
}
.sidebar a:hover { color: var(--text); text-decoration: none; background: var(--surface); }
.sidebar a.active { color: var(--accent); background: rgba(79,209,197,.08); }

.sidebar-profile {
  display: flex !important; align-items: center; gap: 12px;
  padding: 12px 14px !important; margin-bottom: 18px !important;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
}
.sidebar-profile:hover { border-color: var(--accent); }
.sidebar-avatar-img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.sidebar-avatar-fallback {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: rgba(79,209,197,.15); color: var(--accent); font-family: var(--font-display); font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.sidebar-profile-text { display: flex; flex-direction: column; overflow: hidden; }
.sidebar-profile-name { color: var(--text); font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-profile-contact { color: var(--text-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.avatar-upload { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.avatar-preview { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; background: var(--surface-2); border: 1px solid var(--border); }
.avatar-preview-fallback {
  width: 76px; height: 76px; border-radius: 50%; background: rgba(79,209,197,.15); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 28px; font-weight: 700;
}

.device-row { display: flex; align-items: center; gap: 12px; }
.device-icon { font-size: 18px; }

.main-content { padding: 40px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.page-head h1 { font-size: 24px; margin: 0; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-card .label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; font-family: var(--font-mono); }
.stat-card .value { font-family: var(--font-display); font-size: 26px; margin-top: 6px; }

.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 100px; font-size: 12px; font-weight: 600; }
.status-pill.active { background: rgba(79,209,197,.12); color: var(--accent); }
.status-pill.pending { background: rgba(240,180,41,.12); color: var(--warn); }
.status-pill.expired, .status-pill.canceled { background: rgba(139,147,167,.12); color: var(--text-muted); }
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--text-muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--border); }
td { padding: 14px 12px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table-wrap table { margin: 0; }
.table-wrap th, .table-wrap td { padding: 14px 20px; }

.subscription-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.sub-link { display: flex; gap: 10px; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; font-family: var(--font-mono); font-size: 13px; overflow-wrap: anywhere; }

.empty-state { text-align: center; padding: 56px 24px; color: var(--text-muted); }
.empty-state .icon { font-size: 32px; margin-bottom: 12px; }

.steps { counter-reset: step; display: flex; flex-direction: column; gap: 0; }
.step { display: grid; grid-template-columns: 40px 1fr; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--border); }
.step:last-child { border-bottom: none; }
.step::before {
  counter-increment: step; content: counter(step);
  width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 13px; color: var(--accent);
}
.step h4 { margin-bottom: 4px; font-size: 15px; }
.step p { font-size: 14px; margin: 0; }

.download-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 20px 0 8px; }
.download-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 10px; border: 1px solid var(--border); border-radius: 10px; text-align: center; color: var(--text); }
.download-card:hover { border-color: var(--accent); text-decoration: none; }
.download-card .platform-icon { font-size: 22px; }
.download-card .platform-name { font-size: 13px; font-weight: 600; }

footer.site-footer { border-top: 1px solid var(--border); padding: 32px 0; margin-top: 40px; }
footer.site-footer .container { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-muted); }

.badge { display: inline-block; font-family: var(--font-mono); font-size: 11px; padding: 3px 8px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .grid-3, .plans-grid { grid-template-columns: 1fr; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: flex; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border); padding: 12px 16px; }
  .sidebar a { white-space: nowrap; }
  .download-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-row { grid-template-columns: 1fr; }
}
