:root {
  --bg: #0a0f1e;
  --surface: #111827;
  --surface2: #1a2437;
  --surface3: #1f2d42;
  --border: #1e3a5f;
  --border2: #2a4a6b;
  --text: #e2e8f0;
  --text-muted: #7a93b4;
  --text-dim: #4a6080;
  --primary: #3b82f6;
  --primary-glow: rgba(59,130,246,0.2);
  --primary-dark: #1d4ed8;
  --success: #10b981;
  --success-bg: rgba(16,185,129,0.08);
  --warning: #f59e0b;
  --warning-bg: rgba(245,158,11,0.08);
  --danger: #ef4444;
  --danger-bg: rgba(239,68,68,0.08);
  --purple: #8b5cf6;
  --r: 10px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.65;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
}

.wrap { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; padding: 0 20px; }

/* ── Header ── */
header { border-bottom: 1px solid var(--border); padding: 16px 0; }
.header-inner {
  max-width: 900px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 12px;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-icon {
  width: 36px; height: 36px; background: var(--primary);
  border-radius: 8px; display: grid; place-items: center; font-size: 18px;
}
.logo-text { font-weight: 700; font-size: 17px; color: var(--text); }
.logo-text span { color: var(--primary); }

nav { display: flex; gap: 4px; flex: 1; }
nav a {
  color: var(--text-muted); text-decoration: none; font-size: 13px;
  padding: 6px 10px; border-radius: 6px; transition: all .2s;
}
nav a:hover { color: var(--text); background: var(--surface2); }

.lang-switcher {
  display: flex; gap: 2px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 8px; padding: 3px;
}
.lang-switcher a {
  color: var(--text-muted); text-decoration: none; font-size: 12px; font-weight: 600;
  padding: 4px 9px; border-radius: 5px; transition: all .2s; letter-spacing: .04em;
}
.lang-switcher a:hover { color: var(--text); background: var(--surface3); }
.lang-switcher a.lang-active {
  background: var(--primary); color: #fff;
}

/* ── Hero ── */
.hero { padding: 64px 0 40px; text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-glow); border: 1px solid rgba(59,130,246,0.3);
  color: var(--primary); font-size: 12px; font-weight: 600; letter-spacing: .05em;
  padding: 4px 12px; border-radius: 20px; text-transform: uppercase; margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(26px, 5vw, 44px); font-weight: 800;
  line-height: 1.15; margin-bottom: 16px;
  background: linear-gradient(135deg, #fff 0%, #93c5fd 60%, #818cf8 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero p { color: var(--text-muted); font-size: 16px; max-width: 580px; margin: 0 auto 36px; }

/* ── Search form ── */
.search-form { display: flex; gap: 10px; max-width: 640px; margin: 0 auto; }
.search-input-wrap { flex: 1; position: relative; }
.search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-dim); pointer-events: none;
}
input[type="text"] {
  width: 100%; padding: 14px 14px 14px 44px;
  background: var(--surface); border: 1px solid var(--border2);
  color: var(--text); font-size: 15px; border-radius: var(--r);
  outline: none; transition: border-color .2s, box-shadow .2s;
}
input[type="text"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
input::placeholder { color: var(--text-dim); }
.btn-analyze {
  padding: 14px 24px; background: var(--primary);
  color: #fff; border: none; border-radius: var(--r);
  font-size: 15px; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: background .2s, transform .1s;
  display: flex; align-items: center; gap: 8px;
}
.btn-analyze:hover { background: var(--primary-dark); }
.btn-analyze:active { transform: scale(0.98); }
.btn-analyze:disabled { opacity: .5; cursor: not-allowed; }

/* ── Loader ── */
#loader { display: none; text-align: center; padding: 60px 0; }
.spinner {
  width: 48px; height: 48px; border: 3px solid var(--border2);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-steps { color: var(--text-muted); font-size: 13px; }
.loader-steps span { display: block; margin: 4px 0; }

/* ── Results ── */
#results { display: none; padding: 0 0 60px; }

.summary-bar {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 16px 20px;
}
.stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-dim); margin-bottom: 6px; }
.stat-value { font-size: 22px; font-weight: 800; }
.stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.c-green { color: var(--success); }
.c-red   { color: var(--danger); }
.c-yellow{ color: var(--warning); }
.c-blue  { color: var(--primary); }
.c-purple{ color: var(--purple); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); margin-bottom: 16px; overflow: hidden;
}
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; user-select: none;
}
.card-header:hover { background: var(--surface2); }
.card-icon { font-size: 18px; line-height: 1; }
.card-title { font-weight: 700; font-size: 15px; flex: 1; }
.card-badge {
  font-size: 11px; font-weight: 700; padding: 3px 8px;
  border-radius: 20px; letter-spacing: .04em;
}
.badge-green  { background: var(--success-bg); color: var(--success); border: 1px solid rgba(16,185,129,.2); }
.badge-red    { background: var(--danger-bg);  color: var(--danger);  border: 1px solid rgba(239,68,68,.2); }
.badge-yellow { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(245,158,11,.2); }
.badge-grey   { background: var(--surface3);   color: var(--text-muted); border: 1px solid var(--border); }
.chevron { color: var(--text-dim); transition: transform .25s; font-size: 14px; }
.card.open .chevron { transform: rotate(180deg); }
.card-body { display: none; padding: 20px; }
.card.open .card-body { display: block; }

.size-meter { margin: 12px 0 6px; }
.size-meter-bar { height: 8px; border-radius: 4px; background: var(--surface3); overflow: hidden; margin: 6px 0; }
.size-meter-fill { height: 100%; border-radius: 4px; transition: width .6s ease; }
.fill-green  { background: var(--success); }
.fill-yellow { background: var(--warning); }
.fill-red    { background: var(--danger); }
.size-info { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; padding: 8px 12px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim);
  border-bottom: 1px solid var(--border); background: var(--surface2);
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface2); }
.url-cell { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.url-cell a { color: var(--primary); text-decoration: none; font-family: monospace; font-size: 12px; }
.url-cell a:hover { text-decoration: underline; }

.chip { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; font-family: monospace; }
.chip-js    { background: rgba(245,158,11,.15); color: #fcd34d; }
.chip-css   { background: rgba(59,130,246,.15);  color: #93c5fd; }
.chip-green { background: var(--success-bg); color: var(--success); }
.chip-red   { background: var(--danger-bg);  color: var(--danger); }
.chip-grey  { background: var(--surface3);   color: var(--text-muted); }

.mini-bar-wrap { display: flex; align-items: center; gap: 6px; min-width: 90px; }
.mini-bar { height: 4px; border-radius: 2px; background: var(--surface3); flex: 1; overflow: hidden; }
.mini-bar-fill { height: 100%; border-radius: 2px; }

.check-row {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.check-row:last-child { border-bottom: none; padding-bottom: 0; }
.check-icon { font-size: 16px; flex-shrink: 0; margin-top: 2px; }
.check-content { flex: 1; }
.check-label { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.check-value { font-size: 13px; color: var(--text-muted); font-family: monospace; }
.check-note  { font-size: 12px; color: var(--text-dim); margin-top: 3px; }

.sec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sec-item {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 14px;
}
.sec-item-label { font-size: 11px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.sec-item-value { font-size: 13px; color: var(--text-muted); font-family: monospace; word-break: break-all; }
.sec-item.present { border-color: rgba(16,185,129,.2); }
.sec-item.missing  { border-color: rgba(239,68,68,.1); }

.result-url {
  font-family: monospace; font-size: 12px; color: var(--text-muted);
  margin-bottom: 20px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.result-url a { color: var(--primary); text-decoration: none; }
.result-url a:hover { text-decoration: underline; }

/* ── Info section ── */
.info-section { padding: 60px 0; }
.info-section h2 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.info-section .sub { color: var(--text-muted); margin-bottom: 32px; font-size: 14px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px 22px; }
.info-card-icon { font-size: 28px; margin-bottom: 12px; }
.info-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.info-card p  { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* ── FAQ ── */
.faq { margin-top: 40px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; overflow: hidden; }
.faq-q {
  padding: 14px 18px; font-weight: 600; font-size: 14px;
  cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  transition: background .15s;
}
.faq-q:hover { background: var(--surface2); }
.faq-q .faq-arrow { color: var(--text-dim); transition: transform .25s; flex-shrink: 0; margin-left: 12px; }
.faq-item.open .faq-arrow { transform: rotate(180deg); }
.faq-a { display: none; padding: 0 18px 14px; font-size: 13px; color: var(--text-muted); line-height: 1.7; }
.faq-item.open .faq-a { display: block; }

.divider { height: 1px; background: var(--border); margin: 0; }

/* ── CTA / Cooperation ── */
.cta-section { padding: 64px 0; }
.cta-inner {
  background: linear-gradient(135deg, var(--surface2) 0%, var(--surface3) 100%);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 48px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(59,130,246,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.cta-icon { font-size: 40px; margin-bottom: 16px; }
.cta-inner h2 { font-size: 24px; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.cta-inner p { color: var(--text-muted); font-size: 15px; max-width: 520px; margin: 0 auto 28px; }
.cta-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: #14a800; color: #fff;
  padding: 14px 28px; border-radius: 10px;
  font-weight: 600; font-size: 15px; text-decoration: none;
  transition: background .2s, transform .15s;
}
.cta-btn:hover { background: #0e8a00; transform: translateY(-1px); }
.cta-btn svg { flex-shrink: 0; }

footer { border-top: 1px solid var(--border); padding: 24px 0; text-align: center; color: var(--text-dim); font-size: 13px; }
footer a { color: var(--text-muted); text-decoration: none; }
footer a:hover { color: var(--text); }

.error-box {
  display: none; background: var(--danger-bg); border: 1px solid rgba(239,68,68,.25);
  border-radius: 8px; padding: 16px 20px; color: var(--danger); margin-top: 20px;
  font-size: 14px; text-align: center;
}

@media (max-width: 600px) {
  .search-form { flex-direction: column; }
  .hero h1 { font-size: 26px; }
  .summary-bar { grid-template-columns: 1fr 1fr; }
  .sec-grid { grid-template-columns: 1fr; }
  nav { display: none; }
}
