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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f8fafc;
  color: #1a1a2e;
  min-height: 100vh;
  padding: 40px 16px 80px;
}

.container {
  max-width: 820px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 32px;
}

header h1 {
  font-size: 32px;
  font-weight: 700;
  color: #2563eb;
}

.subtitle {
  color: #64748b;
  margin-top: 6px;
  font-size: 15px;
}

.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.input-row {
  display: flex;
  gap: 10px;
}

.input-row input {
  flex: 1;
  padding: 12px 16px;
  font-size: 15px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s;
}

.input-row input:focus {
  border-color: #2563eb;
}

.input-row button {
  padding: 12px 24px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.input-row button:hover { background: #1d4ed8; }
.input-row button:disabled { background: #94a3b8; cursor: not-allowed; }

@media (max-width: 480px) {
  .input-row { flex-direction: column; }
  .input-row button { width: 100%; }
}

/* Loading */
#loading {
  text-align: center;
  padding: 60px 0;
  color: #64748b;
}

#loading p { margin-top: 16px; line-height: 1.8; }
#loading small { font-size: 13px; }

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

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

/* Error */
.error-box {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  border-radius: 8px;
  padding: 16px;
  margin-top: 24px;
}

/* Results */
#results { margin-top: 32px; }

.results-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.overall-score {
  font-size: 52px;
  font-weight: 700;
  color: #2563eb;
  line-height: 1;
  text-align: center;
}

.overall-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  text-align: center;
  margin-top: 4px;
}

.summary-text {
  color: #334155;
  font-size: 14px;
  line-height: 1.7;
}

.btn-pdf {
  display: inline-block;
  padding: 10px 18px;
  background: #fff;
  border: 2px solid #2563eb;
  color: #2563eb;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s;
}

.btn-pdf:hover {
  background: #2563eb;
  color: #fff;
}

/* Section cards */
.sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 600px) {
  .sections { grid-template-columns: 1fr; }
  .results-header { grid-template-columns: 1fr; text-align: center; }
}

.section-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.section-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-name {
  font-size: 15px;
  font-weight: 600;
}

.section-score {
  font-size: 22px;
  font-weight: 700;
  color: #2563eb;
}

.section-score.good { color: #16a34a; }
.section-score.warn { color: #d97706; }
.section-score.bad  { color: #dc2626; }

.score-bar-bg {
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  margin-bottom: 14px;
}

.score-bar-fill {
  height: 4px;
  border-radius: 2px;
  background: #2563eb;
  transition: width 0.6s ease;
}

.section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin: 10px 0 6px;
}

.section-card ul {
  padding-left: 16px;
  font-size: 13px;
  color: #475569;
}

.section-card li { margin-bottom: 4px; }

/* Quick wins */
.quick-wins-card {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 20px;
}

.quick-wins-card h2 {
  font-size: 16px;
  color: #16a34a;
  margin-bottom: 12px;
}

.quick-wins-card ul {
  padding-left: 18px;
  font-size: 14px;
  color: #166534;
}

.quick-wins-card li { margin-bottom: 6px; }

.hidden { display: none !important; }
