@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500&display=swap');

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e3e6eb;
  --border-strong: #c9ced7;
  --text: #1c2128;
  --text-muted: #626b78;
  --text-faint: #8a92a0;

  --accent: #1657d6;
  --accent-hover: #1249b8;
  --accent-tint: #eaf0fd;

  --ok: #1a8f5e;
  --ok-tint: #e7f6ee;
  --problema: #c93838;
  --problema-tint: #fceceb;
  --neutro: #6b7280;
  --neutro-tint: #eef0f2;

  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --shadow-card: 0 16px 32px -20px rgba(28, 33, 40, 0.18);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Topbar ---------- */

.topbar {
  background: #14161a;
  color: #fff;
  padding: 18px clamp(20px, 4vw, 48px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 1080px;
  margin: 0 auto;
}

.topbar__mark {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.02em;
}

.topbar__mark-accent {
  color: #5b8ff9;
}

.topbar__divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.2);
}

.topbar__title {
  font-weight: 500;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.72);
}

/* ---------- Page layout ---------- */

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) clamp(20px, 4vw, 48px) 80px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: clamp(20px, 3vw, 32px);
}

.panel__heading {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.panel__hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 13.5px;
}

/* ---------- Identification ---------- */

.identification .panel__heading {
  margin-bottom: 18px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field__label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.field input {
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

/* ---------- Blocks ---------- */

.blocks {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.block__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 22px clamp(20px, 3vw, 32px) 14px;
  gap: 12px;
}

.block__title-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.block__index {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-tint);
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 500;
}

.block__title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.block__count {
  font-size: 12.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.item-list {
  list-style: none;
  margin: 0;
  padding: 0 clamp(20px, 3vw, 32px);
  display: flex;
  flex-direction: column;
}

.item {
  border-top: 1px solid var(--border);
  padding: 14px 0;
}

.item__row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.item__name {
  flex: 1 1 auto;
  font-size: 14.5px;
  font-weight: 500;
  min-width: 140px;
}

.item__status {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.status-btn {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.status-btn:active {
  transform: scale(0.96);
}

.status-btn--ok[aria-checked="true"] {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}

.status-btn--problema[aria-checked="true"] {
  background: var(--problema);
  border-color: var(--problema);
  color: #fff;
}

.status-btn--nao-testado[aria-checked="true"] {
  background: var(--neutro);
  border-color: var(--neutro);
  color: #fff;
}

.icon-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: var(--problema-tint);
  color: var(--problema);
}

.item__note-wrap {
  padding-top: 10px;
}

.item__note {
  width: 100%;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--problema-tint);
  border: 1px solid #f0c6c2;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  resize: vertical;
}

.item__note:focus {
  outline: none;
  border-color: var(--problema);
}

.item__note::placeholder {
  color: #b98783;
}

/* ---------- Add item row ---------- */

.add-item-row {
  padding: 14px clamp(20px, 3vw, 32px) 22px;
  border-top: 1px solid var(--border);
}

.add-item-trigger {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: none;
  padding: 6px 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.add-item-trigger:hover {
  color: var(--accent-hover);
}

.add-item-form {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.add-item-form input {
  flex: 1 1 auto;
  font-family: inherit;
  font-size: 14px;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.add-item-form input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

/* ---------- Buttons ---------- */

.btn {
  font-family: inherit;
  font-weight: 600;
  font-size: 13.5px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  padding: 9px 16px;
  display: inline-block;
  text-decoration: none;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-hover);
}

.btn--large {
  padding: 13px 24px;
  font-size: 14.5px;
}

.btn--ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-muted);
}

.btn--ghost:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

/* ---------- Finalize panel ---------- */

.finalize-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

/* ---------- Result ---------- */

.result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: clamp(20px, 3vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result__badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.result__badge {
  display: inline-block;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 10px 20px;
  border-radius: 999px;
}

.result__badge--aprovado {
  background: var(--ok-tint);
  color: var(--ok);
}

.result__badge--reprovado {
  background: var(--problema-tint);
  color: var(--problema);
}

.result__summary {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.result__block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result__block-title {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}

.result__item {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 13.5px;
  padding: 4px 0;
}

.result__item-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
  transform: translateY(-1px);
}

.result__item-dot--ok { background: var(--ok); }
.result__item-dot--problema { background: var(--problema); }
.result__item-dot--nao-testado { background: var(--neutro); }

.result__item-note {
  display: block;
  color: var(--text-muted);
  font-size: 12.5px;
  margin-top: 2px;
}

.result__note {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

/* ---------- Infographic preview ---------- */

.infographic {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.infographic__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.infographic__header .panel__heading {
  margin: 0;
}

.infographic__preview-frame {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  justify-content: center;
}

.infographic__preview-frame img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 12px 28px -18px rgba(28, 33, 40, 0.35);
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .item__row {
    flex-wrap: wrap;
  }
  .item__name {
    width: 100%;
  }
  .finalize-panel {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
  }
  .btn--large {
    width: 100%;
  }
}
