/* ══════════════════════════════════════
   SAFEBOX — ГЛОБАЛЬНІ СТИЛІ
══════════════════════════════════════ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:         #080c0e;
  --card:       rgba(255, 255, 255, 0.04);
  --card-border:rgba(255, 255, 255, 0.08);
  --text:       #f0f4f8;
  --muted:      rgba(240, 244, 248, 0.5);
  --btn-border: rgba(255, 255, 255, 0.28);
  --green:      #4ade80;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ══════════════════════════════════════
   ФОН — АТМОСФЕРА
══════════════════════════════════════ */

.bg-atmo {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 28% 18%, rgba(25, 55, 42, 0.65) 0%, transparent 68%),
    radial-gradient(ellipse 45% 40% at 78% 72%, rgba(10, 38, 30, 0.45) 0%, transparent 65%),
    #080c0e;
}

.bg-atmo::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  background-size: 200px;
  opacity: 0.6;
}

/* ══════════════════════════════════════
   НАВІГАЦІЯ
══════════════════════════════════════ */

nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 52px;
  height: 64px;
  background: rgba(8, 12, 14, 0.72);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-logo {
  display: flex;
  align-items: center;
  cursor: pointer;
  text-decoration: none;
}

.logo-text {
  font-family: 'Sora', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: linear-gradient(90deg, #f0f4f8 30%, rgba(74, 222, 128, 0.85) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  cursor: pointer;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ══════════════════════════════════════
   КНОПКИ
══════════════════════════════════════ */

.btn-ghost {
  background: none;
  border: 1px solid var(--btn-border);
  color: var(--text);
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.2s;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.07);
}

.btn-solid {
  background: var(--text);
  color: #080c0e;
  border: none;
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: opacity 0.2s;
}

.btn-solid:hover {
  opacity: 0.88;
}

.btn-primary {
  width: 100%;
  padding: 13px;
  background: var(--text);
  color: #080c0e;
  border: none;
  border-radius: 10px;
  font-family: 'Sora', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-primary:hover {
  opacity: 0.88;
}

/* ══════════════════════════════════════
   СИСТЕМА СТОРІНОК
══════════════════════════════════════ */

.page {
  display: none;
  position: relative;
  z-index: 1;
  padding-top: 64px;
}

.page.active {
  display: block;
}

.page.auth-page {
  display: none;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
}

.page.auth-page.active {
  display: flex;
}

/* ══════════════════════════════════════
   СПІЛЬНІ КОМПОНЕНТИ
══════════════════════════════════════ */

.section {
  padding: 96px 48px;
  max-width: 1080px;
  margin: 0 auto;
}

.section-sm {
  padding: 64px 48px;
  max-width: 1080px;
  margin: 0 auto;
}

h1.hero-title {
  font-family: 'Sora', sans-serif;
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-align: center;
}

h2.section-title {
  font-family: 'Sora', sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
}

.sub {
  color: var(--muted);
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.7;
  margin-top: 14px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* Картка */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 28px;
  transition: border-color 0.25s;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.card-title {
  font-family: 'Sora', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.card-text {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.65;
}

/* Сітки */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* Бейдж */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  padding: 5px 14px;
  font-size: 0.78rem;
  color: var(--muted);
}

.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

/* Іконка-блок */
.icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.icon-box svg {
  width: 22px;
  height: 22px;
  stroke: var(--text);
  fill: none;
  stroke-width: 1.6;
}

/* Підвал */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 32px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

footer span {
  color: var(--muted);
  font-size: 0.8rem;
}

/* ══════════════════════════════════════
   КАСТОМНИЙ ЧЕКБОКС
══════════════════════════════════════ */

.cb-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  cursor: pointer;
  user-select: none;
}

.cb-wrap input[type=checkbox] {
  display: none;
}

.cb-box {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  flex-shrink: 0;
  margin-top: 1px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
  position: relative;
}

.cb-box svg {
  width: 11px;
  height: 11px;
  stroke: #080c0e;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transition: opacity 0.15s;
}

.cb-wrap input:checked + .cb-box {
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.3);
}

.cb-wrap input:checked + .cb-box svg {
  opacity: 1;
}

.cb-wrap:hover .cb-box {
  border-color: rgba(74, 222, 128, 0.5);
}

.cb-label {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.55;
  padding-top: 1px;
}

.cb-label a {
  color: var(--text);
}

/* ══════════════════════════════════════
   ФОРМИ АВТОРИЗАЦІЇ
══════════════════════════════════════ */

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

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo-wrap {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  margin-bottom: 28px;
  cursor: pointer;
}

.auth-logo-text {
  font-family: 'Sora', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: linear-gradient(90deg, #f0f4f8 30%, rgba(74, 222, 128, 0.85) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-header h1 {
  font-family: 'Sora', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
}

.auth-header p {
  color: var(--muted);
  font-size: 0.875rem;
}

.auth-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 36px 32px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

.form-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.form-input:focus {
  border-color: rgba(74, 222, 128, 0.4);
}

.form-input::placeholder {
  color: rgba(240, 244, 248, 0.22);
}

/* Індикатор надійності пароля */
.strength-bar {
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  margin-top: 8px;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s, background 0.3s;
}

.strength-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 5px;
}

/* Блок попередження про головний пароль */
.master-info {
  background: rgba(74, 222, 128, 0.05);
  border: 1px solid rgba(74, 222, 128, 0.15);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.master-info p {
  font-size: 0.8rem;
  color: rgba(240, 244, 248, 0.6);
  line-height: 1.55;
}

.master-info strong {
  color: rgba(74, 222, 128, 0.9);
}

/* Розділювач */
.divider-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}

.divider-line::before,
.divider-line::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.divider-line span {
  font-size: 0.77rem;
  color: var(--muted);
}

.forgot-link {
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
}

.forgot-link:hover {
  color: var(--text);
}

.auth-footer {
  text-align: center;
  margin-top: 22px;
  font-size: 0.84rem;
  color: var(--muted);
}

.auth-footer a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

/* ══════════════════════════════════════
   СТОРІНКА БЕЗПЕКА — ZK ДІАГРАМА
══════════════════════════════════════ */

.zk-diagram {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 48px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 48px;
  position: relative;
  overflow: hidden;
}

.zk-diagram::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 50%, rgba(30, 80, 60, 0.12) 0%, transparent 70%);
}

.zk-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 1;
}

.zk-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.zk-icon svg {
  width: 28px;
  height: 28px;
  stroke: var(--text);
  fill: none;
  stroke-width: 1.4;
}

.zk-label {
  font-family: 'Sora', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
}

.zk-desc {
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
  max-width: 130px;
  line-height: 1.5;
}

.zk-line {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  z-index: 1;
}

.zk-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.zk-lock {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.zk-lock svg {
  width: 14px;
  height: 14px;
  stroke: var(--green);
  fill: none;
  stroke-width: 2;
}

/* Технологічні пілюлі */
.tech-stack {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.tech-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  padding: 6px 16px;
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tech-pill .tp-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}

/* ══════════════════════════════════════
   СТОРІНКА ПРО НАС
══════════════════════════════════════ */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-top: 56px;
}

.about-text h3 {
  font-family: 'Sora', sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 18px;
}

.about-text p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.75;
  margin-bottom: 14px;
}

.about-visual {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-num {
  font-family: 'Sora', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.stat-lbl {
  color: var(--muted);
  font-size: 0.82rem;
}

.stat-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
}

/* ══════════════════════════════════════
   АНІМАЦІЇ
══════════════════════════════════════ */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-up          { animation: fadeUp 0.5s ease both; }
.d1               { animation-delay: 0.1s; }
.d2               { animation-delay: 0.2s; }
.d3               { animation-delay: 0.3s; }

/* ══════════════════════════════════════
   АДАПТИВНІСТЬ
══════════════════════════════════════ */

@media (max-width: 720px) {
  nav { padding: 0 20px; }
  .nav-links { display: none; }
  .section, .section-sm { padding: 56px 20px; }
  .grid-2, .about-grid, .grid-3 { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
  .zk-diagram { flex-direction: column; gap: 24px; }
}
