/* Internativa brand — Дзен Портал */
:root {
  --bg: #ffffff;
  --bg2: #f8fafc;
  --bg3: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --muted2: #94a3b8;
  --border: #e2e8f0;
  --brand: #2563eb;
  --brand-2: #1d4ed8;
  --accent: #7c3aed;
  --accent-2: #6d28d9;
  --grad: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --grad-soft: linear-gradient(135deg, rgba(37,99,235,.08) 0%, rgba(124,58,237,.08) 100%);
  --ok: #16a34a;
  --warn: #f59e0b;
  --danger: #dc2626;
  --r: 14px;
  --r-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05), 0 1px 3px rgba(15,23,42,.06);
  --shadow: 0 4px 6px rgba(15,23,42,.04), 0 10px 20px rgba(15,23,42,.06);
  --shadow-lg: 0 10px 30px rgba(15,23,42,.10);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter",
        "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body { min-height: 100vh; }

a { color: var(--brand); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-2); }

/* topbar */
.topbar {
  background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px; display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 50;
}
.logo {
  font-weight: 700; font-size: 17px; display: flex; align-items: center;
  gap: 9px; color: var(--text);
}
.logo:hover { color: var(--text); }
.logo-icon {
  width: 28px; height: 28px; flex-shrink: 0;
}
.logo-name {
  background: var(--grad); -webkit-background-clip: text;
  background-clip: text; -webkit-text-fill-color: transparent;
}
.topbar nav { margin-left: auto; display: flex; gap: 14px; align-items: center; }
.topbar nav a { color: var(--text); font-weight: 500; font-size: 14px; }
.topbar nav .user { color: var(--muted); font-size: 13px; }
.topbar .btn { padding: 8px 14px; font-size: 13px; }

.menu-toggle { display: none; background: none; border: 0; padding: 6px; cursor: pointer; }
.menu-toggle svg { width: 26px; height: 26px; color: var(--text); }

.mobile-menu { display: none; }

@media (max-width: 720px) {
  .topbar { padding: 12px 16px; }
  .topbar nav { display: none; }
  .menu-toggle { display: flex; }
  .mobile-menu.open {
    display: flex; flex-direction: column; gap: 6px;
    position: fixed; top: 56px; left: 0; right: 0; background: var(--bg);
    border-bottom: 1px solid var(--border); padding: 14px 16px; z-index: 49;
    box-shadow: var(--shadow);
  }
  .mobile-menu a, .mobile-menu form button {
    padding: 10px 12px; border-radius: 8px; font-weight: 500;
    color: var(--text); background: var(--bg2); border: 0; text-align: left;
    cursor: pointer; font: inherit;
  }
  .mobile-menu .user { color: var(--muted); padding: 4px 12px; font-size: 13px; }
}

/* container */
.container { max-width: 920px; margin: 32px auto; padding: 0 24px; }
.container.narrow { max-width: 560px; }
@media (max-width: 720px) {
  .container { margin: 20px auto; padding: 0 16px; }
}

/* typography */
h1 {
  font-size: 32px; margin: 0 0 14px; letter-spacing: -.02em; font-weight: 700;
  line-height: 1.15;
}
h1.gradient {
  background: var(--grad); -webkit-background-clip: text;
  background-clip: text; -webkit-text-fill-color: transparent;
}
h2 { font-size: 22px; margin: 32px 0 14px; letter-spacing: -.01em; font-weight: 600; }
h3 { font-size: 16px; margin: 22px 0 10px; font-weight: 600; color: var(--text); }
.subtitle { color: var(--muted); margin: -6px 0 24px; font-size: 16px; }
@media (max-width: 720px) {
  h1 { font-size: 26px; }
  h2 { font-size: 19px; margin: 24px 0 12px; }
  .subtitle { font-size: 15px; }
}

p { margin: 0 0 12px; }

/* hero */
.hero {
  position: relative; padding: 56px 0 28px; overflow: hidden;
  margin: -32px -24px 32px;
  background: var(--grad-soft);
  border-radius: 0 0 var(--r) var(--r);
}
.hero-content { max-width: 760px; margin: 0 auto; padding: 0 24px; text-align: center; }
.hero h1 { font-size: 40px; margin-bottom: 12px; }
.hero .subtitle { margin-bottom: 24px; font-size: 17px; max-width: 520px;
  margin-left: auto; margin-right: auto; }
.hero .spiral-bg {
  position: absolute; right: -100px; top: 50%; transform: translateY(-50%);
  width: 400px; height: 400px; opacity: .08; pointer-events: none;
}
@media (max-width: 720px) {
  .hero { padding: 36px 0 20px; margin: -20px -16px 24px; }
  .hero h1 { font-size: 28px; }
  .hero .subtitle { font-size: 15px; }
  .hero .spiral-bg { width: 240px; height: 240px; right: -60px; }
}

/* cards */
.card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r);
  padding: 24px; box-shadow: var(--shadow-sm); margin-bottom: 16px;
  transition: box-shadow .2s;
}
.card:hover { box-shadow: var(--shadow); }
.card.soft { background: var(--bg2); border-color: transparent; }
.card.flat { box-shadow: none; }
.card-title { font-weight: 600; margin: 0 0 12px; }
@media (max-width: 720px) { .card { padding: 18px; border-radius: var(--r-sm); } }

/* steps */
.steps {
  display: flex; gap: 6px; margin: 0 0 28px; padding: 4px;
  background: var(--bg2); border-radius: 10px;
}
.step {
  flex: 1; padding: 10px 12px; color: var(--muted); border-radius: 6px;
  font-size: 13px; font-weight: 500; text-align: center;
  transition: all .15s;
}
.step.done { color: var(--ok); background: rgba(22,163,74,.08); }
.step.current { background: var(--grad); color: #fff; box-shadow: var(--shadow-sm); }
@media (max-width: 720px) {
  .steps { gap: 3px; padding: 3px; }
  .step { padding: 8px 6px; font-size: 11px; }
}

/* forms */
label {
  display: block; font-weight: 500; margin: 16px 0 6px;
  font-size: 14px; color: var(--text);
}
label:first-of-type, .card form > label:first-child { margin-top: 0; }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 0; line-height: 1.5; }
input[type=text], input[type=email], input[type=password], input[type=url],
input[type=number], input[type=file], textarea, select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border);
  border-radius: var(--r-sm); background: var(--bg2); color: var(--text);
  font-size: 15px; outline: none; font-family: inherit;
  transition: all .15s;
  -webkit-appearance: none;
}
input[type=file] { padding: 10px 14px; }
textarea {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px;
  min-height: 140px; resize: vertical; line-height: 1.5;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--brand); background: var(--bg);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--r-sm); font-weight: 600;
  font-size: 14px; border: 0; cursor: pointer; text-decoration: none;
  transition: all .15s ease; line-height: 1.2;
  -webkit-appearance: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--grad); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(37,99,235,.25); color: #fff; }
.btn-secondary { background: var(--bg2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg3); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--bg2); color: var(--brand-2); }
.btn-lg { padding: 14px 26px; font-size: 15px; border-radius: 10px; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-row {
  display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap;
}
.btn-row.center { justify-content: center; }
@media (max-width: 560px) {
  .btn-row .btn { flex: 1 1 auto; min-width: 0; }
  .btn-lg { padding: 13px 18px; font-size: 14px; }
}

/* alerts */
.alert {
  padding: 12px 16px; border-radius: var(--r-sm); font-size: 14px;
  margin-bottom: 14px; line-height: 1.55;
}
.alert.error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert.success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.alert.warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert.info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

/* variants grid */
.variants { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 16px 0; }
.variant {
  padding: 18px; border: 1px solid var(--border); border-radius: var(--r);
  background: var(--bg); cursor: pointer; transition: all .15s;
  display: block; color: var(--text);
}
.variant:hover {
  border-color: var(--brand); transform: translateY(-2px);
  box-shadow: var(--shadow); color: var(--text); text-decoration: none;
}
.variant .v-label {
  display: inline-block; padding: 2px 8px; background: var(--grad);
  color: #fff; border-radius: 4px; font-size: 11px; font-weight: 600;
  margin-bottom: 8px; letter-spacing: .04em;
}
.variant .v-name { font-weight: 600; margin-bottom: 6px; font-size: 15px; }
.variant .v-diff { font-size: 13px; color: var(--muted); line-height: 1.5; }
@media (max-width: 720px) { .variants { grid-template-columns: 1fr; } }

/* code */
pre, code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }
pre {
  background: var(--bg3); padding: 14px 16px; border-radius: var(--r-sm);
  overflow-x: auto; border: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
}
code { background: var(--bg3); padding: 2px 6px; border-radius: 4px; font-size: 13px; }
pre code { background: transparent; padding: 0; font-size: 13px; }

/* badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
}
.badge-on { background: #dcfce7; color: #166534; }
.badge-on::before { content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: #22c55e; display: inline-block; }
.badge-off { background: #fef2f2; color: #991b1b; }
.badge-off::before { content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: #ef4444; display: inline-block; }
.badge-pending { background: #fef3c7; color: #92400e; }

/* table */
.tbl {
  width: 100%; border-collapse: collapse; font-size: 14px;
  border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden;
}
.tbl th {
  text-align: left; padding: 10px 14px; font-weight: 600;
  font-size: 12px; color: var(--muted); background: var(--bg2);
  text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
}
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: var(--bg2); }

@media (max-width: 720px) {
  .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch;
    border-radius: var(--r-sm); border: 1px solid var(--border); }
  .tbl { border: 0; border-radius: 0; min-width: 540px; }
}

/* property list (dashboard) */
.props { list-style: none; padding: 0; margin: 0; }
.props li {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 9px 0; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.props li:last-child { border-bottom: 0; }
.props .k { color: var(--muted); flex-shrink: 0; }
.props .v { text-align: right; word-break: break-word; }

/* status pill on hero */
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--bg2); border: 1px solid var(--border);
  font-size: 13px; font-weight: 500; margin-bottom: 14px;
}
.status-pill.on { background: rgba(22,163,74,.08); border-color: rgba(22,163,74,.2); color: #166534; }
.status-pill.off { background: rgba(220,38,38,.06); border-color: rgba(220,38,38,.18); color: #991b1b; }

/* utilities */
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.flex-1 { flex: 1; }
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.divider { height: 1px; background: var(--border); margin: 24px 0; border: 0; }
.tight { line-height: 1.4; }
