/* ===== Variables ===== */
:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: #1a2035;
  --bg-input: #151b2e;

  --eu-blue: #003399;
  --eu-blue-light: #1a4fbd;
  --eu-blue-glow: rgba(0, 51, 153, 0.3);
  --eu-yellow: #ffcc00;
  --eu-yellow-dim: #d4a900;
  --eu-yellow-glow: rgba(255, 204, 0, 0.15);

  --text-primary: #e8ecf4;
  --text-secondary: #9ba3b5;
  --text-muted: #6b7280;

  --green: #22c55e;
  --green-dim: #16a34a;
  --green-bg: rgba(34, 197, 94, 0.1);
  --red: #ef4444;
  --red-dim: #dc2626;
  --red-bg: rgba(239, 68, 68, 0.1);
  --orange: #f59e0b;
  --orange-bg: rgba(245, 158, 11, 0.1);
  --purple: #818cf8;
  --purple-bg: rgba(99, 102, 241, 0.1);
  --eea-color: #60a5fa;
  --eea-bg: rgba(96, 165, 250, 0.1);

  --border: #1e2a45;
  --border-light: #2a3655;

  --radius: 8px;
  --radius-lg: 12px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
}

a {
  color: var(--eu-yellow);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--eu-yellow-dim);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-card);
  padding: 0.15em 0.45em;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Skip link (accessibility) ===== */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  padding: 8px 16px;
  background: var(--eu-yellow);
  color: var(--bg-primary);
  font-weight: 700;
  z-index: 200;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.logo:hover {
  color: var(--text-primary);
}

.logo-accent {
  color: var(--eu-yellow);
}

/* Hamburger toggle (hidden on desktop) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  transition: transform 0.2s, opacity 0.2s;
}

nav {
  display: flex;
  gap: 28px;
}

nav a {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.2s;
}

nav a:hover {
  color: var(--eu-yellow);
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 80px 0 40px;
  background: radial-gradient(ellipse at 50% 0%, var(--eu-blue-glow) 0%, transparent 60%);
}

.hero-stars {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 24px;
}

.star {
  color: var(--eu-yellow);
  font-size: 0.9rem;
  opacity: 0.7;
}

.hero h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.text-accent {
  color: var(--eu-yellow);
}

.hero-sub {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ===== Checker ===== */
.checker-section {
  padding: 40px 0 60px;
}

.search-form {
  max-width: 600px;
  margin: 0 auto;
}

.search-wrapper {
  display: flex;
  gap: 0;
  background: var(--bg-input);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-wrapper:focus-within {
  border-color: var(--eu-blue-light);
  box-shadow: 0 0 0 3px var(--eu-blue-glow);
}

#domain-input {
  flex: 1;
  padding: 16px 20px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 1.05rem;
  font-family: var(--font-mono);
}

#domain-input::placeholder {
  color: var(--text-muted);
}

#check-btn {
  padding: 16px 28px;
  background: var(--eu-blue);
  color: #fff;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

#check-btn:hover {
  background: var(--eu-blue-light);
}

#check-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.search-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 10px;
}

/* ===== Results ===== */
.results {
  margin-top: 32px;
  animation: fadeIn 0.3s ease;
}

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

/* Verdict banner */
.verdict {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  border: 1px solid;
}

.verdict.sovereign {
  background: var(--green-bg);
  border-color: var(--green-dim);
}

.verdict.not-sovereign {
  background: var(--red-bg);
  border-color: var(--red-dim);
}

.verdict.not-sovereign.high {
  background: var(--red-bg);
  border-color: var(--red-dim);
}

.verdict.not-sovereign.critical {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--red);
}

.verdict.partial {
  background: var(--orange-bg);
  border-color: var(--orange);
}

.verdict.dnssec-mitigated {
  background: rgba(96, 165, 250, 0.1);
  border-color: var(--eea-color);
}

.dnssec-detail {
  flex-direction: column;
}

.dnssec-detail p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.65;
}

.verdict-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

.verdict-text h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.verdict-text p {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* DNSSEC panel */
.dnssec-panel {
  margin-bottom: 16px;
}

/* Detail panels */
.result-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}

.result-panel-header {
  padding: 16px 20px;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.result-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.result-row:last-child {
  border-bottom: none;
}

/* Recommendations */
.recommendations .result-row {
  flex-direction: column;
  gap: 4px;
}

.recommendation strong {
  color: var(--eu-yellow);
  font-size: 0.92rem;
}

.recommendation p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.65;
  margin-top: 4px;
}

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-ok {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.badge-fail {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-warn {
  background: var(--orange-bg);
  color: var(--orange);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-info {
  background: var(--purple-bg);
  color: var(--purple);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.badge-eea {
  background: var(--eea-bg);
  color: var(--eea-color);
  border: 1px solid rgba(96, 165, 250, 0.25);
}

.ns-name {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text-primary);
  word-break: break-all;
}

.ns-detail {
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.tld-tag {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.85rem;
}

.tld-tag.eu {
  color: var(--green);
}

.tld-tag.eea {
  color: var(--eea-color);
}

.tld-tag.non-eu {
  color: var(--red);
}

/* ===== Help icon / Tooltips ===== */
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--border-light);
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 800;
  cursor: pointer;
  position: relative;
  vertical-align: middle;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
  user-select: none;
}

.help-icon:hover,
.help-icon:focus {
  background: var(--eu-blue);
  color: #fff;
  outline: none;
}

.help-icon.active::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 300px;
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.55;
  white-space: normal;
  z-index: 50;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.help-icon.active::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--border-light);
  z-index: 51;
}

/* Chain toggle button */
.chain-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 12px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-family: var(--font);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.chain-toggle:hover {
  color: var(--text-secondary);
  border-color: var(--border-light);
  background: rgba(255, 255, 255, 0.03);
}

.chain-toggle-arrow {
  display: inline-block;
  font-size: 0.6rem;
  transition: transform 0.2s;
}

.chain-toggle.open .chain-toggle-arrow {
  transform: rotate(90deg);
}

/* Chain visualization */
.chain-section {
  margin-top: 8px;
  padding-left: 20px;
  border-left: 2px solid var(--border-light);
  animation: fadeIn 0.2s ease;
}

.chain-link {
  padding: 10px 0 10px 16px;
  font-size: 0.84rem;
  position: relative;
}

.chain-link + .chain-link {
  border-top: 1px solid var(--border);
}

.chain-link::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 18px;
  width: 10px;
  height: 2px;
  background: var(--border-light);
}

.chain-link-ok::before {
  background: var(--green-dim);
}

.chain-link-fail::before {
  background: var(--red-dim);
}

.chain-domain {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.84rem;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chain-status-icon {
  font-size: 0.75rem;
  line-height: 1;
}

.chain-link-ok .chain-status-icon {
  color: var(--green);
}

.chain-link-fail .chain-status-icon {
  color: var(--red);
}

.chain-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.chain-ns-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chain-ns-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ===== Error ===== */
.error-box {
  margin-top: 20px;
  padding: 16px 20px;
  background: var(--red-bg);
  border: 1px solid var(--red-dim);
  border-radius: var(--radius);
  color: var(--red);
  font-size: 0.92rem;
  line-height: 1.7;
}

.error-box a.error-link {
  color: var(--eu-yellow);
  text-decoration: underline;
}

/* ===== Content sections ===== */
.content-section {
  padding: 72px 0;
}

.content-section.alt {
  background: var(--bg-secondary);
}

.content-section h2 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 36px;
  text-align: center;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: var(--border-light);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.card-icon {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* Steps */
.steps {
  max-width: 640px;
  margin: 0 auto;
}

.step {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
}

.step:last-child {
  margin-bottom: 0;
}

.step-num {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--eu-blue);
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.step-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.step-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Precedents */
.precedents blockquote {
  background: var(--bg-card);
  border-left: 3px solid var(--eu-yellow);
  padding: 20px 24px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 20px;
}

.precedents blockquote p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-style: italic;
}

.precedents > p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 12px;
}

/* Case studies */
.section-intro {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 640px;
  margin: -12px auto 40px;
}

.case-studies {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}

.case-studies::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-light);
}

.case {
  display: flex;
  gap: 24px;
  margin-bottom: 40px;
  position: relative;
}

.case:last-child {
  margin-bottom: 0;
}

.case-marker {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--eu-yellow);
  position: relative;
  z-index: 1;
}

.case-marker::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--eu-yellow);
}

.case-body {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  transition: border-color 0.2s;
}

.case-body:hover {
  border-color: var(--border-light);
}

.case-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--eu-yellow);
  background: var(--eu-yellow-glow);
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.case-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 12px;
}

.case-body p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 10px;
}

.case-body p:last-child {
  margin-bottom: 0;
}

.case-body a {
  color: var(--eu-yellow);
  text-decoration: underline;
  text-decoration-color: rgba(255, 204, 0, 0.3);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.2s;
}

.case-body a:hover {
  text-decoration-color: var(--eu-yellow);
}

/* ===== Footer ===== */
.site-footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.site-footer p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.footer-note {
  font-size: 0.78rem !important;
  color: var(--text-muted) !important;
  margin-top: 6px;
}

/* ===== Spinner ===== */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-light);
  border-top-color: var(--eu-yellow);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
    border-top-color: var(--eu-yellow);
    opacity: 0.7;
  }

  .results {
    animation: none;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .search-wrapper {
    flex-direction: column;
  }

  #check-btn {
    border-top: 1px solid var(--border);
  }

  /* Hamburger menu */
  .nav-toggle {
    display: flex;
  }

  nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    gap: 16px;
  }

  nav.open {
    display: flex;
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .hero {
    padding: 56px 0 32px;
  }

  .content-section {
    padding: 48px 0;
  }

  .step {
    gap: 14px;
  }

  .case-studies::before {
    left: 11px;
  }

  .case-marker {
    width: 24px;
    height: 24px;
  }

  .case-marker::after {
    width: 8px;
    height: 8px;
  }

  .case {
    gap: 16px;
  }

  .case-body {
    padding: 18px 20px;
  }

  /* Tooltip repositioning on mobile */
  .help-icon.active::after {
    left: auto;
    right: -8px;
    transform: none;
    max-width: 260px;
  }

  .help-icon.active::before {
    left: auto;
    right: 4px;
    transform: none;
  }
}
