@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 {
  --bg: #0A0E1A;
  --bg-elevated: #0F1526;
  --card: #131B2E;
  --border: #24304A;
  --text: #EDF1F7;
  --muted: #7C8AA6;
  --accent: #3E9DFF;
  --accent2: #7FC4FF;
  --gradient: linear-gradient(135deg, #3E9DFF 0%, #7FC4FF 100%);
  --accent-ink: #FFFFFF;
  --success: #3EE6A0;
  --error: #FF6B7A;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 16px;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: 560px; }

h1, h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h1 { font-size: 30px; margin-bottom: 8px; line-height: 1.15; }

.subtitle { color: var(--muted); margin-bottom: 32px; font-size: 15px; line-height: 1.5; }

.site-logo {
  display: block;
  width: 56px;
  height: 56px;
  margin: 0 auto 8px;
  border-radius: 14px;
}

.hero-canvas {
  position: relative;
  width: 100%;
  height: 170px;
  margin-bottom: 20px;
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.hero-canvas svg { width: 100%; height: 100%; display: block; }
.globe-line { fill: none; stroke: #253352; stroke-width: 1; }
.globe-outline { fill: none; stroke: #2C3B5E; stroke-width: 1.2; }
.globe-node { fill: var(--accent); }
.globe-ping {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  opacity: 0;
  transform-origin: center;
  animation: ping 2.4s ease-out infinite;
}
@keyframes ping {
  0% { opacity: 0.8; transform: scale(0.3); }
  80% { opacity: 0; transform: scale(2.6); }
  100% { opacity: 0; }
}
.orbit-path { fill: none; stroke: none; }
.orbit-dot { fill: var(--accent); filter: drop-shadow(0 0 5px rgba(62, 157, 255, 0.7)); }

.device-row {
  display: flex;
  justify-content: space-between;
  margin: 4px 0 24px;
  padding: 0 4px;
}
.device-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
}
.device-icon svg { width: 20px; height: 20px; stroke: var(--muted); fill: none; stroke-width: 1.6; }

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  background: rgba(62, 157, 255, 0.1);
  border: 1px solid rgba(62, 157, 255, 0.3);
  padding: 5px 10px;
  border-radius: 8px;
  margin-bottom: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 16px;
}

.plan {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.plan:hover { border-color: var(--accent); background: rgba(62, 157, 255, 0.05); }
.plan input { accent-color: var(--accent); margin-right: 12px; }
.plan-name { font-weight: 500; }
.plan-price { font-family: 'JetBrains Mono', monospace; color: var(--accent); font-weight: 500; }

label { display: block; font-size: 13px; color: var(--muted); margin: 18px 0 6px; }

input[type=email], input[type=text], input[type=password], input[type=number] {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 15px;
  font-family: 'Inter', sans-serif;
}
input[type=email]:focus, input[type=text]:focus, input[type=password]:focus, input[type=number]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(62, 157, 255, 0.15);
}

button, .btn {
  display: inline-block;
  width: 100%;
  text-align: center;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: var(--gradient);
  color: var(--accent-ink);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  margin-top: 20px;
  transition: filter .15s, transform .1s;
}
button:hover, .btn:hover { filter: brightness(1.1); }
button:active, .btn:active { transform: scale(0.98); }

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-secondary:hover { background: var(--bg-elevated); filter: none; }

.price-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}
.price-row:last-of-type { border-bottom: none; font-weight: 600; font-size: 18px; padding-top: 14px; }

.key-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  word-break: break-all;
  margin: 16px 0;
}

.badge-success {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--success);
  font-weight: 500;
  margin-bottom: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
}

.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.footer-note { color: var(--muted); font-size: 13px; text-align: center; margin-top: 24px; }

.nav { text-align: right; margin-bottom: 20px; font-size: 14px; }
.nav a { color: var(--muted); text-decoration: none; transition: color .15s; }
.nav a:hover { color: var(--accent); }

.error-msg {
  background: rgba(255, 107, 122, 0.1);
  border: 1px solid rgba(255, 107, 122, 0.3);
  color: var(--error);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 4px;
}

.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 14px;
  color: var(--text);
}

.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.admin-row:last-child { border-bottom: none; }
.admin-row-name { font-weight: 500; flex: 1; min-width: 160px; font-family: 'JetBrains Mono', monospace; font-size: 14px; }
.muted-inline { color: var(--muted); font-weight: 400; font-size: 13px; font-family: 'Inter', sans-serif; }
.tag-off {
  display: inline-block;
  background: rgba(255, 107, 122, 0.1);
  color: var(--error);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 8px;
  margin-left: 6px;
  font-family: 'Inter', sans-serif;
}

.inline-form { display: flex; gap: 6px; margin: 0; }
.inline-form input[type=number] {
  width: 90px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
}
.btn-small {
  width: auto;
  margin-top: 0;
  padding: 8px 14px;
  font-size: 13px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  border-radius: 10px;
  background: var(--gradient);
  color: var(--accent-ink);
  border: none;
  cursor: pointer;
}
.btn-small:hover { filter: brightness(1.1); }
.btn-secondary-small {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-secondary-small:hover { background: var(--bg-elevated); filter: none; }

.badge-image {
  display: block;
  width: 160px;
  height: 160px;
  margin: 0 auto 16px;
}

.admin-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 20px;
  -webkit-overflow-scrolling: touch;
}
.admin-nav::-webkit-scrollbar { height: 4px; }
.admin-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.admin-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 64px;
  padding: 10px 8px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  transition: border-color .15s, color .15s;
}
.admin-nav a span.icon { font-size: 18px; }
.admin-nav a.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(62, 157, 255, 0.08);
}
.admin-nav a:hover { border-color: var(--accent); color: var(--accent); }

.chart-card { margin-bottom: 16px; }
.chart-card canvas { max-height: 180px; }

.gauge-row {
  display: flex;
  justify-content: space-around;
  margin: 8px 0 16px;
}
.gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.gauge svg { transform: rotate(-90deg); }
.gauge-bg { fill: none; stroke: var(--border); stroke-width: 8; }
.gauge-fill { fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; }
.gauge-label-wrap { position: relative; width: 84px; height: 84px; }
.gauge-value {
  position: absolute; top: 0; left: 0; width: 84px; height: 84px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 16px;
}
.gauge-name { font-size: 12px; color: var(--muted); text-align: center; }
.gauge-sub { font-size: 10px; color: var(--muted); text-align: center; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(32px); }
  to { opacity: 1; transform: translateY(0); }
}
.card { animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both; }
.card:nth-of-type(1) { animation-delay: 0.05s; }
.card:nth-of-type(2) { animation-delay: 0.2s; }
.card:nth-of-type(3) { animation-delay: 0.35s; }
.card:nth-of-type(4) { animation-delay: 0.5s; }
.card:nth-of-type(5) { animation-delay: 0.65s; }
.card:nth-of-type(n+6) { animation-delay: 0.8s; }

@keyframes pulseBtn {
  0%, 100% { box-shadow: 0 0 0 0 rgba(62, 157, 255, 0.7); transform: scale(1); }
  50% { box-shadow: 0 0 0 14px rgba(62, 157, 255, 0); transform: scale(1.02); }
}
.btn-pulse { animation: pulseBtn 1.6s ease-in-out infinite; }

.status-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-radius: 12px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 16px;
}
.status-badge.up { background: rgba(62, 230, 160, 0.1); color: var(--success); }
.status-badge.down { background: rgba(255, 107, 122, 0.1); color: var(--error); }
.status-badge.unknown { background: rgba(124, 138, 166, 0.1); color: var(--muted); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }

.status-grid {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.status-day {
  width: 6px;
  height: 24px;
  border-radius: 2px;
  background: var(--border);
}
.status-day.up { background: var(--success); }
.status-day.down { background: var(--error); }
.status-day.partial { background: #FFB020; }

/* ===== STAGING: премиальный редизайн главной ===== */
:root {
  --purple: #7C3AED;
  --cyan: #22D3EE;
}

.glass {
  background: rgba(19, 27, 46, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
}

.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  z-index: -1;
  pointer-events: none;
}
.blob-1 { width: 380px; height: 380px; background: var(--purple); top: -100px; left: -100px; animation: blobMove 14s ease-in-out infinite; }
.blob-2 { width: 320px; height: 320px; background: var(--accent); bottom: -80px; right: -80px; animation: blobMove 18s ease-in-out infinite reverse; }
.blob-3 { width: 260px; height: 260px; background: var(--cyan); top: 40%; left: 60%; animation: blobMove 20s ease-in-out infinite; }
@keyframes blobMove {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(30px,-30px) scale(1.1); }
}

.hero-big-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 20px 0 12px;
}
.hero-big-title .grad {
  background: linear-gradient(135deg, var(--accent), var(--purple), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.glow-btn {
  position: relative;
  overflow: hidden;
}
.glow-btn::after {
  content: '';
  position: absolute; inset: -2px;
  background: linear-gradient(135deg, var(--accent), var(--purple), var(--cyan));
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity .3s;
  filter: blur(12px);
}
.glow-btn:hover::after { opacity: 0.8; }

.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 20px 0;
}
.feature-card {
  padding: 18px 14px;
  border-radius: 18px;
  transition: transform .25s, border-color .25s;
}
.feature-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.feature-card .f-icon { font-size: 26px; margin-bottom: 8px; display: block; }
.feature-card .f-title { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.feature-card .f-desc { font-size: 12px; color: var(--muted); line-height: 1.4; }

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

.faq-item { border-bottom: 1px solid var(--border); }
.faq-question {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 0; cursor: pointer; font-weight: 500;
}
.faq-arrow { transition: transform .3s; color: var(--accent); }
.faq-item.open .faq-arrow { transform: rotate(180deg); }
.faq-answer {
  max-height: 0; overflow: hidden; transition: max-height .35s ease;
  color: var(--muted); font-size: 14px; line-height: 1.5;
}
.faq-item.open .faq-answer { padding-bottom: 16px; }

.pricing-highlight {
  position: relative;
  border: 1px solid var(--accent) !important;
  box-shadow: 0 0 24px rgba(62, 157, 255, 0.25);
}
.pricing-badge {
  position: absolute; top: -10px; right: 16px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: white; font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px;
}

.f-icon-badge {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
  margin-bottom: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}
.f-icon-badge.grad-purple { background: linear-gradient(135deg, #7C3AED, #A78BFA); }
.f-icon-badge.grad-blue { background: linear-gradient(135deg, #3B82F6, #60A5FA); }
.f-icon-badge.grad-cyan { background: linear-gradient(135deg, #22D3EE, #67E8F9); }
.f-icon-badge.grad-pink { background: linear-gradient(135deg, #EC4899, #F472B6); }

.f-icon-badge svg {
  width: 20px; height: 20px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px rgba(255,255,255,0.8));
}

/* Переопределяем бейджи иконок — неоновая рамка + свечение вместо заливки */
.f-icon-badge {
  background: rgba(15, 21, 38, 0.8) !important;
  border: 1.5px solid;
}
.f-icon-badge svg { stroke: currentColor !important; filter: drop-shadow(0 0 6px currentColor); }

.f-icon-badge.grad-purple { border-color: #A78BFA; color: #A78BFA; box-shadow: 0 0 16px rgba(124, 58, 237, 0.5); }
.f-icon-badge.grad-blue   { border-color: #60A5FA; color: #60A5FA; box-shadow: 0 0 16px rgba(59, 130, 246, 0.5); }
.f-icon-badge.grad-cyan   { border-color: #67E8F9; color: #67E8F9; box-shadow: 0 0 16px rgba(34, 211, 238, 0.5); }
.f-icon-badge.grad-pink   { border-color: #F472B6; color: #F472B6; box-shadow: 0 0 16px rgba(236, 72, 153, 0.5); }

:root {
  --gradient: linear-gradient(135deg, #3E9DFF, #7C3AED, #22D3EE);
}

/* Общие стили для заставки и фона частиц (нужны на всех страницах) */
body { overflow-x: hidden; position: relative; }
#particles-bg { position: fixed; top:0; left:0; width:100%; height:100%; z-index:-2; }
.intro-veil {
  position: fixed; inset: 0; background: var(--bg); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .6s ease, visibility .6s ease;
}
.intro-veil.hide { opacity: 0; visibility: hidden; }
.intro-veil img { width: 64px; height: 64px; animation: pulseLogo 1.2s ease-in-out infinite; }
@keyframes pulseLogo { 0%,100%{ transform: scale(1); opacity:1; } 50%{ transform: scale(1.15); opacity:0.7; } }

.instr-title { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.instr-title .f-icon-badge { margin-bottom: 0; flex-shrink: 0; }
.instr-title h2 { margin: 0; }

.nav-icon {
  width: 13px; height: 13px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -2px;
  margin-right: 3px;
  filter: drop-shadow(0 0 3px var(--accent));
}
