/* ===== Design Tokens ===== */
:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f1f3f8;
  --text: #16181d;
  --text-muted: #5b6270;
  --border: #e3e6ec;
  --primary: #4338ca;
  --primary-hover: #362bab;
  --primary-soft: #eef0ff;
  --success: #12875a;
  --success-soft: #e6f6ee;
  --warn: #b7791f;
  --warn-soft: #fdf3dc;
  --danger: #c0392b;
  --danger-soft: #fbe9e7;
  --radius: 14px;
  --shadow: 0 4px 20px rgba(20,20,40,.06);
  --font-body: 'Inter', system-ui, sans-serif;
  --font-head: 'Outfit', system-ui, sans-serif;
  --header-h: 68px;
}

[data-theme="dark"] {
  --bg: #0f1117;
  --surface: #171a23;
  --surface-2: #1e222c;
  --text: #eef0f5;
  --text-muted: #a2a8b6;
  --border: #2a2e3a;
  --primary: #8b7ff5;
  --primary-hover: #a49bff;
  --primary-soft: #232144;
  --success: #3fd08a;
  --success-soft: #10301f;
  --warn: #e0ac4a;
  --warn-soft: #392c10;
  --danger: #e2665b;
  --danger-soft: #3a1815;
  --shadow: 0 4px 22px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background .25s ease, color .25s ease;
}
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.25; margin: 0 0 .6em; }
p { margin: 0 0 1em; color: var(--text-muted); }
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 10px; font-weight: 600; cursor: pointer; border: 1px solid transparent;
  font-family: var(--font-body); transition: all .18s ease; text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-lg { padding: 14px 26px; font-size: 1rem; }
.btn-sm { padding: 8px 16px; font-size: .875rem; }
.btn:disabled { opacity: .65; cursor: not-allowed; }
.btn-spinner {
  display: none; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite;
}
.btn.loading .btn-spinner { display: inline-block; }
.btn.loading .btn-text { opacity: .85; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Cookie Banner ===== */
.cookie-banner {
  position: fixed; bottom: 16px; left: 16px; right: 16px; z-index: 999;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  border-radius: var(--radius); padding: 16px 18px; display: none;
  flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 640px; margin: 0 auto;
}
.cookie-banner.show { display: flex; }
.cookie-banner p { margin: 0; font-size: .875rem; color: var(--text); flex: 1 1 260px; }
.cookie-actions { display: flex; gap: 8px; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 500; background: var(--surface);
  border-bottom: 1px solid var(--border); height: var(--header-h);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; gap: 16px; }
.logo { font-family: var(--font-head); font-weight: 800; font-size: 1.25rem; color: var(--text); white-space: nowrap; }
.logo span { color: var(--primary); }

.main-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; align-items: center; }
.main-nav > ul > li > a, .dropdown-toggle {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 8px;
  color: var(--text); font-weight: 500; font-size: .92rem; background: none; border: none;
  cursor: pointer; font-family: var(--font-body);
}
.main-nav > ul > li > a:hover, .dropdown-toggle:hover { background: var(--surface-2); }
.chevron { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); display: inline-block; margin-top: -2px; }

.has-dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: 100%; left: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow); list-style: none; margin: 6px 0 0; padding: 8px;
  min-width: 260px; max-height: 400px; overflow-y: auto; display: none; z-index: 600;
}
.has-dropdown.open .dropdown-menu { display: block; }
.dropdown-menu li a { display: block; padding: 8px 10px; border-radius: 6px; font-size: .875rem; color: var(--text); }
.dropdown-menu li a:hover { background: var(--primary-soft); color: var(--primary); }

.header-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text);
}
.theme-toggle svg { fill: none; stroke: currentColor; stroke-width: 1.8; position: absolute; }
.theme-toggle { position: relative; }
.icon-moon { opacity: 0; }
[data-theme="dark"] .icon-sun { opacity: 0; }
[data-theme="dark"] .icon-moon { opacity: 1; }

.hamburger { display: none; flex-direction: column; gap: 5px; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; align-items: center; justify-content: center; }
.hamburger span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: .2s; }

/* ===== Breadcrumb ===== */
.breadcrumb-nav { padding: 14px 20px; }
.breadcrumb-nav ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; font-size: .82rem; color: var(--text-muted); }
.breadcrumb-nav li:not(:last-child)::after { content: '/'; margin-left: 6px; color: var(--text-muted); }
.breadcrumb-nav a { color: var(--text-muted); }
.breadcrumb-nav a:hover { color: var(--primary); }

/* ===== Hero ===== */
.hero { text-align: center; padding: 48px 20px 32px; }
.hero-badge {
  display: inline-block; background: var(--primary-soft); color: var(--primary); font-size: .78rem;
  font-weight: 700; padding: 6px 14px; border-radius: 999px; margin-bottom: 18px; letter-spacing: .3px;
}
.hero h1 { font-size: clamp(1.7rem, 4.2vw, 2.6rem); max-width: 780px; margin-inline: auto; }
.hero-sub { max-width: 640px; margin: 0 auto 28px; font-size: 1.02rem; }
.tester-form { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; max-width: 640px; margin: 0 auto; }
.input-wrap { flex: 1 1 320px; text-align: left; }
#urlInput {
  width: 100%; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 1rem; font-family: var(--font-body);
}
#urlInput:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
#urlInput.invalid { border-color: var(--danger); }
.input-error { display: block; min-height: 18px; font-size: .8rem; color: var(--danger); margin-top: 4px; }
.hero-note { font-size: .8rem; color: var(--text-muted); margin-top: 12px; }

/* ===== Tools Strip ===== */
.tools-strip { padding: 20px 20px 40px; }
.strip-title { text-align: center; font-size: 1.25rem; }
.tools-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
}
.tools-grid a {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 10px; font-size: .82rem; font-weight: 500; color: var(--text); text-align: center;
}
.tools-grid a:hover { border-color: var(--primary); color: var(--primary); }

/* ===== Results ===== */
.results-section { padding: 30px 20px 50px; }
.results-header { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; justify-content: space-between; margin-bottom: 18px; }
.results-header h2 { margin: 0; }
.score-ring-wrap { position: relative; width: 120px; height: 120px; }
.score-ring { width: 120px; height: 120px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--border); stroke-width: 10; }
.ring-fg { fill: none; stroke: var(--success); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 327; stroke-dashoffset: 327; transition: stroke-dashoffset 1s ease, stroke .3s ease; }
.score-number { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-size: 1.7rem; font-weight: 800; }
.results-actions { display: flex; gap: 10px; }
.result-meta { font-size: .85rem; color: var(--text-muted); margin-bottom: 20px; padding: 12px 16px; background: var(--surface-2); border-radius: 10px; word-break: break-word; }
.result-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.result-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.result-card h4 { margin: 0 0 6px; font-size: .95rem; display: flex; align-items: center; gap: 8px; }
.result-card p { margin: 0; font-size: .85rem; }
.status-pill { display: inline-block; font-size: .68rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .3px; }
.status-pass { background: var(--success-soft); color: var(--success); }
.status-warn { background: var(--warn-soft); color: var(--warn); }
.status-fail { background: var(--danger-soft); color: var(--danger); }

/* ===== Features / Steps ===== */
.features, .how-it-works, .seo-content, .faq, .cta { padding: 50px 20px; }
.features h2, .how-it-works h2, .faq h2, .cta h2, .seo-content h2 { text-align: center; margin-bottom: 30px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.feature-card h3 { font-size: 1.05rem; }
.feature-card p { font-size: .88rem; margin: 0; }

.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.step { text-align: center; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 800;
  font-family: var(--font-head); margin-bottom: 12px;
}
.step h3 { font-size: 1rem; }
.step p { font-size: .85rem; }

.seo-content p { font-size: .92rem; max-width: 900px; margin: 0 auto; color: var(--text-muted); }

.faq-list { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; }
.faq-item summary { cursor: pointer; font-weight: 600; }
.faq-item p { margin: 10px 0 0; font-size: .88rem; }

.cta { text-align: center; }
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }

/* ===== Footer ===== */
.site-footer { background: var(--surface-2); border-top: 1px solid var(--border); padding-top: 40px; margin-top: 30px; }
.footer-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px; padding-bottom: 30px; }
.footer-col h4 { font-size: .9rem; margin-bottom: 12px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-col a { font-size: .82rem; color: var(--text-muted); }
.footer-col a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--border); padding: 18px 20px; text-align: center; }
.footer-bottom p { font-size: .75rem; margin: 4px 0; }

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
  .tools-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .main-nav { position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0; background: var(--surface);
    transform: translateX(100%); transition: transform .25s ease; overflow-y: auto; padding: 10px 0; z-index: 400; }
  .main-nav.open { transform: translateX(0); }
  .main-nav ul { flex-direction: column; align-items: stretch; padding: 0 16px; }
  .main-nav > ul > li > a, .dropdown-toggle { width: 100%; justify-content: space-between; }
  .dropdown-menu { position: static; box-shadow: none; border: none; margin: 0; padding-left: 10px; max-height: 0; overflow: hidden; display: block; transition: max-height .2s ease; }
  .has-dropdown.open .dropdown-menu { max-height: 800px; }
  .hamburger { display: flex; }
}
@media (max-width: 640px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .results-header { flex-direction: column; align-items: flex-start; }
}
