:root {
  --bg: #f6f8fc;
  --panel: #ffffff;
  --panel-dark: #0f1b2d;
  --line: #d9e2ef;
  --line-soft: #e9eef6;
  --text: #13233a;
  --muted: #62748c;
  --brand: #163b6d;
  --accent: #2ec5ff;
  --accent-2: #1e86e3;
  --good: #31c48d;
  --warn: #f5b942;
  --bad: #ef6b73;
  --shadow: 0 20px 45px rgba(17, 38, 66, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(46, 197, 255, 0.10), transparent 26%),
    linear-gradient(180deg, #ffffff 0%, #f5f8fc 100%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.topbar-inner {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand img {
  height: 56px;
  width: auto;
  display: block;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-switch {
  display: grid;
  gap: 6px;
}

.lang-switch label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lang-switch select {
  min-width: 140px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font: inherit;
}

.shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 70px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: 28px;
  align-items: stretch;
}

.hero-copy {
  padding: 22px 8px 10px 0;
}

.eyebrow {
  margin: 0;
  color: var(--accent-2);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
}

h1 {
  margin-top: 14px;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 800;
}

.lead {
  max-width: 48rem;
  margin: 22px 0 0;
  color: var(--muted);
  line-height: 1.75;
  font-size: 1.02rem;
}

.audit-form {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

.audit-form input {
  flex: 1;
  min-width: 0;
  padding: 17px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 1rem;
  box-shadow: var(--shadow);
}

.audit-mode-select {
  min-width: 190px;
  padding: 17px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font: inherit;
  box-shadow: var(--shadow);
}

.audit-form button {
  padding: 17px 22px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent-2), #1a74d1);
  color: white;
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(30, 134, 227, 0.24);
}

button:disabled,
.download-btn:disabled {
  cursor: wait;
  opacity: 0.82;
}

.status-text,
.loading-copy {
  color: var(--muted);
  line-height: 1.65;
}

.status-text {
  margin: 14px 0 0;
}

.status-text.is-busy {
  color: var(--accent-2);
}

.hero-panel {
  display: flex;
}

.hero-monitor {
  width: 100%;
  background: var(--panel-dark);
  color: #edf6ff;
  border-radius: 26px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(11, 25, 45, 0.24);
}

.hero-monitor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #b6c7dc;
  font-size: 0.98rem;
}

.hero-monitor-head strong {
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.9rem;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.hero-metrics div {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-metrics span {
  display: block;
  color: #a8bad0;
  font-size: 0.9rem;
}

.hero-metrics strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
  line-height: 1;
  color: white;
}

.hero-chart {
  position: relative;
  margin-top: 16px;
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(46, 197, 255, 0.10), rgba(46, 197, 255, 0.02)),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  min-height: 148px;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 40px 32px;
  opacity: 0.35;
}

.hero-chart svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 148px;
  display: block;
}

.hero-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: #c6d7ea;
  font-size: 0.96rem;
}

.hero-alert-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 6px rgba(49, 196, 141, 0.14);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.loading-panel {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 18px 22px;
  margin-top: 22px;
}

.spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(22, 59, 109, 0.12);
  border-top-color: var(--accent-2);
  animation: spin 0.8s linear infinite;
}

.results {
  margin-top: 26px;
}

.legal-hero {
  padding: 12px 0 24px;
}

.legal-lead {
  max-width: 56rem;
}

.legal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.legal-card {
  padding: 24px;
}

.legal-card p {
  line-height: 1.75;
  color: var(--muted);
}

.legal-list p {
  margin: 0 0 10px;
}

.legal-card strong {
  color: var(--text);
}

.score-grid {
  display: grid;
  grid-template-columns: 1.45fr repeat(4, 1fr);
  gap: 14px;
}

.score-card {
  padding: 22px;
}

.score-card-main {
  background:
    radial-gradient(circle at top right, rgba(46, 197, 255, 0.14), transparent 35%),
    white;
}

.score-value {
  margin-top: 10px;
  font-size: clamp(3rem, 5vw, 4.3rem);
  font-weight: 700;
  line-height: 1;
  color: var(--brand);
}

.score-value.small {
  font-size: 2.3rem;
}

.metric-line {
  margin: 10px 0 0;
  color: var(--muted);
}

.content-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.content-grid > .panel {
  padding: 22px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-2), #1a74d1);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(30, 134, 227, 0.2);
}

.metrics-grid,
.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric-card,
.detail-card {
  padding: 14px;
  border-radius: 16px;
  background: #f8fbff;
  border: 1px solid var(--line-soft);
}

.metric-card p,
.detail-card p {
  margin: 0;
}

.metric-card .label,
.detail-card .label {
  color: var(--muted);
  font-size: 0.84rem;
}

.metric-card .value,
.detail-card .value {
  margin-top: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand);
}

.list,
.issues-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 18px 0 0;
  list-style: none;
}

.list li,
.issue-item {
  padding: 14px;
  border-radius: 16px;
  background: #f8fbff;
  border: 1px solid var(--line-soft);
}

.issue-item {
  display: flex;
  gap: 14px;
  align-items: start;
}

.severity {
  flex: 0 0 auto;
  min-width: 88px;
  padding: 8px 10px;
  border-radius: 999px;
  text-align: center;
  font-size: 0.77rem;
  font-weight: 700;
  text-transform: uppercase;
}

.severity.high {
  background: rgba(239, 107, 115, 0.12);
  color: var(--bad);
}

.severity.medium {
  background: rgba(245, 185, 66, 0.14);
  color: #a46c00;
}

.severity.low {
  background: rgba(49, 196, 141, 0.12);
  color: #14845c;
}

.issue-copy p {
  margin: 0;
}

.issue-copy .category {
  margin-bottom: 6px;
  color: var(--muted);
  text-transform: capitalize;
  font-size: 0.86rem;
}

.hidden {
  display: none;
}

.footer {
  border-top: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.9);
}

.footer-inner {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--muted);
}

.download-btn.loading::after {
  content: "";
  width: 14px;
  height: 14px;
  margin-left: 10px;
  display: inline-block;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  vertical-align: -2px;
}

.pdf-report {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 794px;
  padding: 0;
  background: #f5f8fc;
  color: #13233a;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

.pdf-sheet {
  background:
    radial-gradient(circle at top left, rgba(46, 197, 255, 0.12), transparent 26%),
    linear-gradient(180deg, #ffffff 0%, #f7f9fd 100%);
  min-height: 1123px;
  padding: 42px 42px 36px;
}

.pdf-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px;
  background: linear-gradient(135deg, #10243f 0%, #163b6d 55%, #1e86e3 100%);
  color: #fff;
  border-radius: 28px;
  box-shadow: 0 18px 42px rgba(17, 38, 66, 0.18);
}

.pdf-brand img {
  width: 190px;
  height: auto;
  display: block;
}

.pdf-eyebrow {
  margin: 0 0 10px;
  color: rgba(255, 255, 255, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 700;
}

.pdf-header h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: #fff;
}

.pdf-header p {
  margin: 10px 0 0;
  max-width: 360px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.55;
  font-size: 14px;
}

.pdf-meta {
  min-width: 210px;
  display: grid;
  gap: 12px;
}

.pdf-meta-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.pdf-meta-card .label,
.pdf-card .label,
.pdf-list-card .label {
  margin: 0;
  color: #6a7d94;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 700;
}

.pdf-meta-card .label {
  color: rgba(255, 255, 255, 0.7);
}

.pdf-meta-card .value {
  margin: 8px 0 0;
  color: #fff;
  line-height: 1.45;
  font-size: 13px;
  word-break: break-word;
}

.pdf-section {
  margin-top: 26px;
  page-break-inside: avoid;
}

.pdf-section-head {
  margin-bottom: 14px;
}

.pdf-section-head h2 {
  margin: 8px 0 0;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.pdf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.pdf-score-grid {
  display: grid;
  grid-template-columns: 1.2fr repeat(4, 1fr);
  gap: 14px;
}

.pdf-card,
.pdf-list-card {
  background: #fff;
  border: 1px solid #e4ebf5;
  border-radius: 22px;
  padding: 18px 18px 16px;
  box-shadow: 0 14px 36px rgba(17, 38, 66, 0.08);
}

.pdf-score-card {
  min-height: 126px;
}

.pdf-score-card.primary {
  background: linear-gradient(145deg, #0f1b2d 0%, #163b6d 100%);
  color: #fff;
  border-color: transparent;
}

.pdf-score-card.primary .label,
.pdf-score-card.primary .score-meta {
  color: rgba(255, 255, 255, 0.74);
}

.pdf-score-value {
  margin: 10px 0 0;
  font-size: 54px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.pdf-score-card:not(.primary) .pdf-score-value {
  font-size: 42px;
  color: #163b6d;
}

.score-meta {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.45;
}

.pdf-card .value {
  margin: 8px 0 0;
  font-size: 20px;
  line-height: 1.3;
  color: #163b6d;
  font-weight: 700;
  word-break: break-word;
}

.pdf-card .subvalue {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #62748c;
}

.pdf-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.pdf-list li {
  position: relative;
  padding-left: 18px;
  color: #334861;
  line-height: 1.6;
  font-size: 14px;
}

.pdf-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2ec5ff, #1e86e3);
}

.pdf-list-card.issue-card {
  border-left: 4px solid #ef6b73;
}

.pdf-list-card.reco-card {
  border-left: 4px solid #31c48d;
}

.pdf-footer {
  margin-top: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  color: #62748c;
  font-size: 12px;
}

.pdf-footer strong {
  color: #163b6d;
}

.footer a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

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

@media (max-width: 1040px) {
  .hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .score-grid,
  .content-grid {
    grid-template-columns: 1fr 1fr;
  }

  .legal-grid {
    grid-template-columns: 1fr;
  }

  .score-card-main {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .topbar-inner,
  .shell {
    width: min(100% - 24px, 100%);
  }

  .footer-inner {
    width: min(100% - 24px, 100%);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 12px 0;
  }

  .topbar-inner,
  .hero-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero,
  .hero-monitor,
  .content-grid > .panel,
  .score-card,
  .loading-panel {
    border-radius: 20px;
  }

  .hero-copy {
    padding-right: 0;
  }

  .audit-form,
  .score-grid,
  .content-grid,
  .metrics-grid,
  .details-grid,
  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .audit-form {
    display: grid;
  }
}
