/* ========= БАЗА ========= */
:root{
  --bg: #0b1220;
  --surface: #0f172a;
  --muted: #94a3b8;
  --text: #e5e7eb;
  --primary: #60a5fa;        /* blue-400 */
  --primary-600:#3b82f6;     /* blue-500 */
  --border: rgba(148,163,184,.2);
  --success:#22c55e;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 14px;
  --container: 1200px;
}

/* светлая тема по умолчанию */
@media (prefers-color-scheme: light) {
  :root{
    --bg:#f6f7fb;
    --surface:#ffffff;
    --muted:#6b7280;
    --text:#0f172a;
    --primary:#2563eb;
    --primary-600:#1d4ed8;
    --border: rgba(2,6,23,.08);
    --shadow: 0 10px 30px rgba(2,6,23,.08);
  }
}

/* тёмная тема */
@media (prefers-color-scheme: dark) {
  :root{
    --bg:#0b1220;
    --surface:#0f172a;
    --muted:#94a3b8;
    --text:#e5e7eb;
    --primary:#60a5fa;
    --primary-600:#3b82f6;
    --border: rgba(148,163,184,.2);
    --shadow: 0 10px 30px rgba(0,0,0,.35);
  }
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji","Segoe UI Emoji";
  color:var(--text);
  background: radial-gradient(1200px 600px at 50% -10%, rgba(99,102,241,.18), transparent 60%) , var(--bg);
  line-height:1.6;
}

/* ====== контейнер/сетka ====== */
.container{
  width: min(100% - 32px, var(--container));
  margin-inline:auto;
}

.grid{
  display:grid;
  grid-template-columns:1fr;
}
.gap-lg{ gap: 20px; }

@media (min-width: 780px){
  .grid{
    grid-template-columns: 1fr;
  }
}

/* ====== шапка ====== */
.site-header{
  position: sticky; top:0; z-index: 20;
  backdrop-filter: saturate(120%) blur(6px);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  border-bottom:1px solid var(--border);
}
.site-header .container{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 0;
}
.brand{
  color:var(--text);
  font-weight:800; letter-spacing:.2px; text-decoration:none;
  font-size:20px;
}
.top-nav{ display:flex; gap:14px; }
.nav-link{
  color:var(--muted); text-decoration:none; font-weight:600; font-size:14px;
  padding:8px 10px; border-radius:10px; transition: .2s ease color, .2s ease background;
}
.nav-link:hover, .nav-link.active{ color:var(--text); background:color-mix(in srgb, var(--primary) 14%, transparent); }

/* ====== карточки ====== */
.card{
  margin:28px 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 94%, transparent) 0%, var(--surface) 100%);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.card-title{
  margin: 4px 0 6px;
  font-size: clamp(20px, 2.4vw, 28px);
}
.muted{ color:var(--muted); margin-top:0 }

/* ====== формы ====== */
.form-field label{
  display:block; font-weight:700; margin-bottom:8px;
}
input[type="text"], textarea{
  width:100%;
  padding:14px 16px;
  color:var(--text);
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:12px;
  outline:none;
  transition: border-color .2s ease, box-shadow .2s ease, transform .04s ease;
}
input[type="text"]:focus, textarea:focus{
  border-color: color-mix(in srgb, var(--primary) 60%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 24%, transparent);
}
textarea{ resize: vertical; min-height: 160px; }

/* badges, boxes */
.badge{
  display:inline-block; padding:6px 10px; border-radius:999px; border:1px solid var(--border);
  background:color-mix(in srgb, var(--primary) 12%, transparent);
  color:var(--text); font-weight:700; font-size:13px;
}
.text-box{
  border:1px solid var(--border); border-radius:12px; padding:16px;
  background: var(--surface);
  white-space: pre-wrap;
}

/* ====== кнопки ====== */
.btn{
  appearance:none; border:none; cursor:pointer;
  border-radius:12px; padding:12px 16px; font-weight:800;
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  color:var(--text); border:1px solid var(--border);
  transition: transform .05s ease, background .15s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn:hover{ transform: translateY(-1px); }
.btn:active{ transform: translateY(0); }
.btn.success{ border-color: color-mix(in srgb, var(--success) 50%, var(--border)); background: color-mix(in srgb, var(--success) 16%, var(--surface)); }

.btn-ghost{
  background:transparent;
}
.btn-primary{
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-600) 100%);
  color:white; border-color: transparent;
  box-shadow: 0 10px 20px color-mix(in srgb, var(--primary) 36%, transparent);
}
.btn-primary:hover{ filter: saturate(110%); transform: translateY(-1px); }

/* spinner в кнопке */
.btn .btn-spinner{
  --s: 18px;
  width: var(--s); height: var(--s); margin-right:10px;
  border-radius:50%;
  border: 2px solid rgba(255,255,255,.6);
  border-top-color: rgba(255,255,255,1);
  display:none;
  animation: spin .8s linear infinite;
}
.btn.loading .btn-spinner{ display:inline-block; }
@keyframes spin{to{transform:rotate(360deg);}}

/* сетка действий */
.form-actions{ display:flex; gap:12px; flex-wrap:wrap; }

/* ====== «скелетон»-лоадер и оверлей ====== */
.page-overlay{
  position: fixed; inset:0; z-index: 50;
  display:none; align-items:center; justify-content:center;
  backdrop-filter: blur(4px);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
}
html.loading .page-overlay{ display:flex; }

.skeleton-card{
  width:min(680px, 92vw);
  border-radius:16px; padding:24px;
  background: var(--surface); border:1px solid var(--border); box-shadow: var(--shadow);
}
.skeleton-line{
  height:14px; margin:10px 0; border-radius:8px; position:relative; overflow:hidden;
  background: color-mix(in srgb, var(--surface) 86%, var(--bg));
}
.skeleton-line::after{
  content:""; position:absolute; inset:0;
  background: linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--text) 12%, transparent) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: shimmer 1.35s infinite;
}
.w-60{ width:60% } .w-70{ width:70% } .w-80{ width:80% } .w-90{ width:90% }
@keyframes shimmer{ 100%{ transform: translateX(100%);}}

/* ====== футер ====== */
.site-footer{
  margin: 26px 0 40px;
  color: var(--muted);
}
.site-footer .link{ color: inherit; }

/* мелкие улучшения */
a{ color: var(--primary); text-decoration: none; }
a:hover{ text-decoration: underline; }

