:root {
  --bg: #0b1120;
  --bg-hero: #0f172a;
  --bg-card: #1e293b;
  --bg-input: #162032;
  --border: #1e3a5f;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-dark: #0369a1;
  --high: #ef4444;
  --medium: #f59e0b;
  --low: #eab308;
  --pass: #22c55e;
  --info: #94a3b8;
  --radius: 10px;
  --font-mono: "SF Mono", "Fira Code", "Consolas", monospace;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* Header */
header {
  border-bottom: 1px solid rgba(56,189,248,0.1);
  padding: 16px 0;
  background: var(--bg-hero);
}
header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}
.author {
  color: var(--text-muted);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s;
}
.author:hover { color: var(--accent); }

/* Hero */
.hero {
  background: var(--bg-hero);
  border-bottom: 1px solid rgba(56,189,248,0.1);
  padding: 56px 0 48px;
  text-align: center;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}
.pill {
  background: rgba(56,189,248,0.1);
  border: 1px solid rgba(56,189,248,0.2);
  border-radius: 100px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 4px 12px;
  text-transform: uppercase;
}

.hero h1 {
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 14px;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #e2e8f0 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto 32px;
  font-size: 17px;
  line-height: 1.7;
}

/* Form */
.input-row {
  display: flex;
  gap: 8px;
  max-width: 560px;
  margin: 0 auto;
}
input[type="text"] {
  flex: 1;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 17px;
  padding: 14px 18px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.12);
}
input[type="text"]::placeholder { color: var(--text-muted); }

button[type="submit"] {
  background: linear-gradient(135deg, var(--accent), #0ea5e9);
  border: none;
  border-radius: var(--radius);
  color: #0b1120;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 28px;
  transition: opacity 0.2s, transform 0.1s;
  white-space: nowrap;
}
button[type="submit"]:hover { opacity: 0.92; transform: translateY(-1px); }
button[type="submit"]:active { transform: translateY(0); }
button[type="submit"]:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.privacy-note {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 10px;
  opacity: 0.8;
}

.input-error {
  color: var(--high);
  font-size: 14px;
  margin-top: 8px;
  text-align: center;
}

/* Why section */
.why-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 820px;
  margin: 44px auto 0;
  text-align: left;
}
.why-block {
  background: rgba(30,41,59,0.5);
  border: 1px solid rgba(56,189,248,0.08);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.why-icon {
  font-size: 24px;
  margin-bottom: 10px;
}
.why-block h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: -0.1px;
  -webkit-text-fill-color: var(--text);
  background: none;
}
.why-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
}
.why-list li {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
  padding-left: 14px;
  position: relative;
}
.why-list li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}
.why-list li strong {
  color: var(--text);
  font-weight: 600;
}

/* Features grid */
.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 32px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.feature {
  background: rgba(30,41,59,0.6);
  border: 1px solid rgba(56,189,248,0.08);
  border-radius: var(--radius);
  padding: 16px;
  text-align: left;
  transition: border-color 0.2s;
}
.feature:hover { border-color: rgba(56,189,248,0.2); }
.feature-icon { font-size: 22px; margin-bottom: 8px; }
.feature-label { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.feature-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* Main area */
main > .container { padding-top: 40px; padding-bottom: 60px; }

/* Grade card */
.grade-card {
  display: flex;
  align-items: center;
  gap: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 32px;
  margin-bottom: 28px;
}
.grade-circle {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  border: 3px solid;
  transition: all 0.3s;
}
.grade-A-plus  { color: #10b981; border-color: #10b981; background: rgba(16,185,129,0.1); }
.grade-A       { color: #22c55e; border-color: #22c55e; background: rgba(34,197,94,0.1); }
.grade-B       { color: #84cc16; border-color: #84cc16; background: rgba(132,204,22,0.1); }
.grade-C       { color: #f59e0b; border-color: #f59e0b; background: rgba(245,158,11,0.1); }
.grade-D       { color: #f97316; border-color: #f97316; background: rgba(249,115,22,0.1); }
.grade-F       { color: #ef4444; border-color: #ef4444; background: rgba(239,68,68,0.1); }

.grade-right { flex: 1; min-width: 0; }
.grade-right h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.3px; }
.meta { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.summary-text { color: var(--text-muted); margin-top: 6px; font-size: 15px; }

.findings-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.count-badge {
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.count-high   { background: rgba(239,68,68,0.15);  color: #ef4444; }
.count-medium { background: rgba(245,158,11,0.15); color: #f59e0b; }
.count-low    { background: rgba(234,179,8,0.15);  color: #eab308; }
.count-info   { background: rgba(148,163,184,0.12); color: #94a3b8; }

/* Sections grid */
.sections-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.sections-grid .card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.card h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-icon { font-size: 15px; }

.card-recommendations { margin-bottom: 16px; }

/* Check list */
.check-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.check-item { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; }
.check-icon { flex-shrink: 0; font-size: 15px; margin-top: 1px; width: 18px; text-align: center; }
.check-label { flex: 1; }
.check-value {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  margin-top: 2px;
  word-break: break-all;
}

/* Colors */
.color-pass   { color: var(--pass); }
.color-high   { color: var(--high); }
.color-medium { color: var(--medium); }
.color-low    { color: var(--low); }
.color-info   { color: var(--info); }

/* Recommendations */
.recommendations { display: flex; flex-direction: column; gap: 14px; padding-left: 20px; }
.recommendations li { font-size: 14px; line-height: 1.6; }
.rec-severity {
  display: inline-block;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 1px 6px;
  text-transform: uppercase;
  margin-right: 6px;
  vertical-align: middle;
}
.rec-sev-high   { background: rgba(239,68,68,0.15); color: #ef4444; }
.rec-sev-medium { background: rgba(245,158,11,0.15); color: #f59e0b; }
.rec-sev-low    { background: rgba(234,179,8,0.15); color: #eab308; }
.rec-title { font-weight: 600; color: var(--text); }
.rec-body { color: var(--text-muted); margin-top: 4px; font-family: var(--font-mono); font-size: 12px; }

/* CTA */
.cta {
  background: linear-gradient(135deg, rgba(56,189,248,0.07), rgba(14,165,233,0.04));
  border: 1px solid rgba(56,189,248,0.18);
  border-radius: var(--radius);
  margin-top: 8px;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.cta-text strong { display: block; font-size: 16px; margin-bottom: 4px; }
.cta-text p { color: var(--text-muted); font-size: 14px; }
.cta-btn {
  background: linear-gradient(135deg, var(--accent), #0ea5e9);
  border-radius: var(--radius);
  color: #0b1120;
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 24px;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.1s;
  white-space: nowrap;
}
.cta-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* Spinner */
.spinner { text-align: center; padding: 56px 0; }
.spinner-ring {
  width: 52px;
  height: 52px;
  border: 3px solid rgba(56,189,248,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner p { color: var(--text-muted); margin-bottom: 24px; font-size: 15px; }

.progress-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
  margin: 0 auto;
  text-align: left;
}
.progress-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-muted);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.progress-step.visible { opacity: 1; transform: translateY(0); }
.progress-step.done { color: var(--pass); }
.progress-step.active { color: var(--text); }
.step-icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }

/* Error box */
.error-box {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: var(--radius);
  color: var(--high);
  padding: 16px 20px;
  margin-top: 24px;
  text-align: center;
}

/* Footer */
footer {
  border-top: 1px solid rgba(56,189,248,0.08);
  padding: 20px 0;
  text-align: center;
  margin-top: auto;
}
footer p { color: var(--text-muted); font-size: 13px; }
footer a { color: var(--text-muted); text-decoration: none; }
footer a:hover { color: var(--accent); }

/* Responsive */
@media (max-width: 640px) {
  .hero h1 { font-size: 28px; }
  .hero { padding: 40px 0 36px; }
  .input-row { flex-direction: column; }
  .why-section { grid-template-columns: 1fr; gap: 16px; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .grade-card { flex-direction: column; text-align: center; gap: 20px; }
  .findings-counts { justify-content: center; }
  .sections-grid { grid-template-columns: 1fr; }
  .sections-grid .card:last-child:nth-child(odd) { grid-column: auto; }
  .cta { flex-direction: column; text-align: center; }
}
@media (max-width: 380px) {
  .features { grid-template-columns: 1fr 1fr; }
}
