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

:root {
  --bg:          #0d0f14;
  --surface:     #141720;
  --surface-2:   #1c2030;
  --border:      #252a38;
  --text:        #d4d8e8;
  --text-muted:  #5e6680;
  --text-faint:  #3a3f54;
  --accent:      #4f7ef8;
  --accent-dim:  #2e4a9a;
  --green:       #2ecc71;
  --amber:       #f39c12;
  --red:         #e74c3c;
  --radius:      6px;
  --font:        'Inter', system-ui, -apple-system, sans-serif;
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

/* ── Layout ──────────────────────────────────────────────────────────────── */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1.25rem 4rem;
}

.container {
  width: 100%;
  max-width: 680px;
}

/* ── Wordmark / header ───────────────────────────────────────────────────── */
.wordmark {
  display: flex;
  flex-direction: column;
  margin-bottom: 3.5rem;
}

.wordmark__label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.wordmark__name {
  font-size: 1.55rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.wordmark__sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.55rem;
  max-width: 440px;
}

/* ── Scan form ───────────────────────────────────────────────────────────── */
.scan-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

input[type="text"],
select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.97rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.18s;
  appearance: none;
  -webkit-appearance: none;
}

input[type="text"]::placeholder {
  color: var(--text-faint);
}

input[type="text"]:focus,
select:focus {
  border-color: var(--accent);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235e6680' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

select option {
  background: var(--surface-2);
}

/* ── Submit button ───────────────────────────────────────────────────────── */
.btn-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.9rem 1.25rem;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-size: 0.97rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.18s, opacity 0.18s;
  margin-top: 0.5rem;
}

.btn-submit:hover:not(:disabled) {
  background: #3f6ce8;
}

.btn-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-submit__price {
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.8;
}

/* ── Error message ───────────────────────────────────────────────────────── */
.error-msg {
  font-size: 0.85rem;
  color: var(--red);
  padding: 0.6rem 0.85rem;
  background: rgba(231, 76, 60, 0.08);
  border: 1px solid rgba(231, 76, 60, 0.25);
  border-radius: var(--radius);
}

/* ── Disclaimer ──────────────────────────────────────────────────────────── */
.disclaimer {
  margin-top: 2rem;
  font-size: 0.78rem;
  color: var(--text-faint);
  line-height: 1.5;
}

/* ── Loading state ───────────────────────────────────────────────────────── */
.loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 4rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

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

/* ── Report: header ──────────────────────────────────────────────────────── */
.report-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.report-domain {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.report-score-row {
  display: flex;
  align-items: flex-end;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.report-score {
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #fff;
  line-height: 1;
}

.report-score__denom {
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--text-muted);
}

.tier-badge {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
}

.tier-badge--eligible  { background: var(--green); }
.tier-badge--partial   { background: var(--amber); }
.tier-badge--risk      { background: var(--red); }

.report-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── Report: executive summary ───────────────────────────────────────────── */
.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.summary-card__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.summary-card__text {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text);
  white-space: pre-line;
}

/* ── Report: section cards ───────────────────────────────────────────────── */
.sections-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.section-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  cursor: pointer;
  user-select: none;
  gap: 1rem;
}

.section-card__name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
}

.section-card__score {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.section-card__chevron {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.2s;
  margin-left: 0.5rem;
}

.section-card--open .section-card__chevron {
  transform: rotate(180deg);
}

.section-card__body {
  display: none;
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
}

.section-card--open .section-card__body {
  display: block;
}

/* ── Check list ──────────────────────────────────────────────────────────── */
.check-list {
  list-style: none;
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.87rem;
}

.check-item__icon {
  flex-shrink: 0;
  margin-top: 0.1rem;
  font-size: 0.75rem;
  width: 16px;
  text-align: center;
}

.check-item--passed .check-item__icon { color: var(--green); }
.check-item--failed .check-item__icon { color: var(--red); }
.check-item--penalty .check-item__icon { color: var(--amber); }

.check-item__content {
  flex: 1;
}

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

.check-item--failed .check-item__label { color: var(--text-muted); }

.check-item__detail {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.check-item__pts {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-faint);
  margin-top: 0.1rem;
}

.check-item--passed .check-item__pts { color: var(--green); }

/* ── Report footer ───────────────────────────────────────────────────────── */
.report-footer {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.report-footer__note {
  font-size: 0.78rem;
  color: var(--text-faint);
  max-width: 420px;
}

.report-footer__link {
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--accent);
}

/* ── Error page ──────────────────────────────────────────────────────────── */
.error-page {
  text-align: center;
  padding: 4rem 0;
}

.error-page__title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--red);
  margin-bottom: 0.75rem;
}

.error-page__msg {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ── Utility ─────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .report-score { font-size: 3rem; }
  .wordmark__name { font-size: 1.3rem; }
  .report-footer { flex-direction: column; align-items: flex-start; }
}
