@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@400;600;700;900&display=swap');
@import url('https://api.fontshare.com/v2/css?f[]=chillax@400,500,600&display=swap');

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

:root {
  --accent:      #F63A21;
  --accent-dim:  rgba(246, 58, 33, 0.15);
  --accent-glow: rgba(246, 58, 33, 0.35);
  --bg:          #080808;
  --bg-card:     #111111;
  --bg-card2:    #161616;
  --border:      rgba(255,255,255,0.07);
  --border-acc:  rgba(246,58,33,0.3);
  --text:        #e8e8e8;
  --text-muted:  #888;
  --green:       #22c55e;
  --green-dim:   rgba(34,197,94,0.12);
  --yellow:      #eab308;
  --yellow-dim:  rgba(234,179,8,0.12);
  --red:         #ef4444;
  --red-dim:     rgba(239,68,68,0.12);
  --font-head:   'Unbounded', sans-serif;
  --font-body:   'Chillax', sans-serif;
  --radius:      12px;
  --radius-lg:   20px;
  --transition:  0.2s ease;
}

[data-theme="light"] {
  --bg:       #f5f4f2;
  --bg-card:  #ffffff;
  --bg-card2: #f0efed;
  --border:   rgba(0,0,0,0.08);
  --text:     #111111;
  --text-muted: #666666;
  --green-dim:  rgba(34,197,94,0.1);
  --yellow-dim: rgba(234,179,8,0.1);
  --red-dim:    rgba(239,68,68,0.1);
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Layout ── */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Noise overlay ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* ── Hero header ── */
.hero {
  padding: 72px 0 48px;
  text-align: center;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-dim);
  border: 1px solid var(--border-acc);
  color: var(--accent);
  font-family: var(--font-head);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 28px;
}

.hero-badge .dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-sub {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 520px;
  margin: 0 auto 48px;
}

/* ── Mode tabs ── */
.mode-tabs {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  gap: 4px;
  margin-bottom: 32px;
  width: fit-content;
  margin-inline: auto;
}

.mode-tab {
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-tab svg { opacity: 0.5; transition: var(--transition); }

.mode-tab.active {
  background: var(--accent);
  color: #fff;
}

.mode-tab.active svg { opacity: 1; }

.mode-tab:not(.active):hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

.mode-tab.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.tab-badge {
  font-size: 10px;
  background: rgba(255,255,255,0.1);
  padding: 2px 7px;
  border-radius: 100px;
  letter-spacing: 0.05em;
}

.mode-tab.active .tab-badge {
  background: rgba(255,255,255,0.2);
}

/* ── Form card ── */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 48px;
  position: relative;
  overflow: hidden;
}

.form-card form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

/* ── GDPR row ── */
.gdpr-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gdpr-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.gdpr-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.gdpr-check {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.gdpr-label input:checked ~ .gdpr-check {
  background: var(--accent);
  border-color: var(--accent);
}

.gdpr-label input:checked ~ .gdpr-check::after {
  content: '';
  display: block;
  width: 4px;
  height: 8px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
}

.gdpr-label input:focus-visible ~ .gdpr-check {
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.gdpr-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.gdpr-text a {
  color: var(--accent);
  text-decoration: none;
}

.gdpr-text a:hover { text-decoration: underline; }

.input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.input-group input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-group input::placeholder { color: var(--text-muted); }

.input-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.input-group input.error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.15);
}

.input-error {
  font-size: 12px;
  color: var(--red);
  min-height: 18px;
}

.btn-analyze {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 16px 24px;
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), box-shadow var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
}

.btn-analyze:hover:not(:disabled) {
  background: #d42e18;
  box-shadow: 0 0 24px var(--accent-glow);
}

.btn-analyze:disabled { cursor: not-allowed; }

.btn-content {
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity var(--transition);
}

.btn-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.btn-spinner svg { animation: spin 0.9s linear infinite; }

.btn-analyze.loading .btn-content { opacity: 0; }
.btn-analyze.loading .btn-spinner { opacity: 1; }

.btn-content .btn-icon { transition: transform var(--transition); }
.btn-analyze:hover:not(:disabled) .btn-icon { transform: translateX(2px); }

/* ── Form loading overlay ── */
#form-loading {
  position: absolute;
  inset: 0;
  background: var(--bg-card);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 24px;
  text-align: center;
}

.form-loading-ring {
  width: 64px;
  height: 64px;
}

.form-loading-ring svg {
  width: 64px;
  height: 64px;
}

.form-loading-title {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
}

.form-loading-url {
  font-size: 12px;
  color: var(--accent);
  margin-top: 2px;
  word-break: break-all;
  max-width: 360px;
}

.form-loading-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 300px;
}

.fls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-card2);
  border: 1px solid var(--border);
  transition: all 0.35s ease;
}

.fls-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.35s ease;
}

.fls.active {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.fls.active .fls-dot {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
  animation: pulse-dot 1s infinite;
}

.fls.done {
  color: var(--green);
  border-color: rgba(34,197,94,0.25);
  background: var(--green-dim);
}

.fls.done .fls-dot { background: var(--green); }

/* ── Loading state ── */
#loading {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding: 64px 0;
  text-align: center;
}

.loader-ring {
  position: relative;
  width: 80px;
  height: 80px;
}

.loader-ring svg {
  width: 80px;
  height: 80px;
  animation: spin 1.4s linear infinite;
}

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

.loader-ring .track {
  fill: none;
  stroke: var(--border);
  stroke-width: 3;
}

.loader-ring .progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 180;
  stroke-dashoffset: 60;
}

.loader-url {
  font-family: var(--font-head);
  font-size: 13px;
  color: var(--accent);
  word-break: break-all;
  max-width: 400px;
}

.loader-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 360px;
}

.loader-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-muted);
  transition: all 0.4s ease;
}

.loader-step.active {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-dim);
}

.loader-step.done {
  border-color: rgba(34,197,94,0.3);
  color: var(--green);
  background: var(--green-dim);
}

.loader-step .step-icon { font-size: 16px; }

/* ── Error state ── */
#error-state {
  display: none;
  text-align: center;
  padding: 48px 0;
}

.error-box {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: inline-block;
  max-width: 480px;
}

.error-box h3 {
  font-family: var(--font-head);
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--red);
}

.error-box p { color: var(--text-muted); font-size: 14px; }

.btn-retry {
  margin-top: 20px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 24px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}

.btn-retry:hover { border-color: var(--accent); color: var(--accent); }

/* ── Results ── */
#results { display: none; }

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.results-url {
  font-size: 13px;
  color: var(--text-muted);
  word-break: break-all;
}

.results-url strong {
  color: var(--accent);
  font-family: var(--font-head);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}

/* ── Score dial ── */
.score-section {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 32px;
}

.score-dial {
  position: relative;
  width: 140px;
  height: 140px;
  flex-shrink: 0;
}

.score-dial svg {
  width: 140px;
  height: 140px;
  transform: rotate(-90deg);
}

.score-dial .dial-track {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}

.score-dial .dial-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-number {
  font-family: var(--font-head);
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
}

.score-max {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.score-info h2 {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.score-info p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
  max-width: 380px;
}

.score-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.score-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.score-meta-value {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
}

.score-meta-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Critical issues ── */
.critical-section {
  background: rgba(239,68,68,0.06);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 32px;
}

.section-title {
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .title-accent { color: var(--accent); }
.section-title .title-red { color: var(--red); }

.critical-items { display: flex; flex-direction: column; gap: 12px; }

.critical-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.critical-icon {
  width: 32px;
  height: 32px;
  background: rgba(239,68,68,0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.critical-label {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 3px;
}

.critical-impact {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Category groups ── */
.categories { display: flex; flex-direction: column; gap: 16px; margin-bottom: 48px; }

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  cursor: pointer;
  transition: background var(--transition);
  user-select: none;
}

.category-header:hover { background: var(--bg-card2); }

.category-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.category-name {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.category-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.category-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cat-progress-wrap {
  width: 100px;
  height: 4px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}

.cat-progress-bar {
  height: 100%;
  border-radius: 100px;
  background: var(--accent);
  transition: width 0.8s ease;
}

.cat-score-text {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--text-muted);
  min-width: 40px;
  text-align: right;
}

.cat-chevron {
  color: var(--text-muted);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.category-card.open .cat-chevron { transform: rotate(180deg); }

.category-checks {
  display: none;
  border-top: 1px solid var(--border);
}

.category-card.open .category-checks { display: block; }

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.check-item:last-child { border-bottom: none; }
.check-item:hover { background: var(--bg-card2); }

.check-status {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  font-size: 12px;
}

.check-status.passed { background: var(--green-dim); color: var(--green); }
.check-status.warning { background: var(--yellow-dim); color: var(--yellow); }
.check-status.failed { background: var(--red-dim); color: var(--red); }

.check-label {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-detail {
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.check-impact {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.check-fix {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  padding: 6px 10px;
  background: var(--bg-card2);
  border-left: 2px solid var(--border);
  border-radius: 0 4px 4px 0;
}

.check-fix strong { color: var(--text); }

/* ── CTA section ── */
.cta-section {
  background: var(--bg-card);
  border: 1px solid var(--border-acc);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 64px;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  pointer-events: none;
}

.cta-section h2 {
  font-family: var(--font-head);
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
  position: relative;
}

.cta-section p {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 440px;
  margin: 0 auto 32px;
  line-height: 1.6;
  position: relative;
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 16px 36px;
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  position: relative;
}

.btn-cta:hover {
  background: #d42e18;
  box-shadow: 0 8px 32px var(--accent-glow);
  transform: translateY(-2px);
}

.cta-note {
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-muted);
  position: relative;
}

/* ── Theme toggle ── */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 100;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--transition);
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--text);
}

.theme-toggle .toggle-icon { font-size: 14px; line-height: 1; }

/* ── Color states ── */
.color-green { color: var(--green); }
.color-yellow { color: var(--yellow); }
.color-orange { color: #f97316; }
.color-red { color: var(--red); }

.cat-icon.seo-icon { background: rgba(139,92,246,0.15); }
.cat-icon.tracking-icon { background: rgba(59,130,246,0.15); }
.cat-icon.gdpr-icon { background: rgba(234,179,8,0.15); }
.cat-icon.perf-icon { background: rgba(249,115,22,0.15); }
.cat-icon.ux-icon { background: rgba(34,197,94,0.15); }
.cat-icon.tech-icon { background: rgba(156,163,175,0.15); }

/* ── Responsiveness ── */
@media (max-width: 640px) {
  .input-row { flex-direction: column; }
  .score-section { grid-template-columns: 1fr; text-align: center; }
  .score-meta { justify-content: center; }
  .score-dial { margin: 0 auto; }
  .cta-section { padding: 32px 24px; }
  .form-card { padding: 24px 20px; }
  .mode-tabs { width: 100%; }
  .mode-tab { flex: 1; justify-content: center; }
}
