:root {
  --miwe-yellow: #ffdd2f;
  --blue: #2f62df;
  --blue-dark: #2148a8;
  --green: #86c42a;
  --orange: #ff9d28;
  --red: #e00000;
  --gray: #9b9b9b;
  --ink: #1d1f23;
  --muted: #61646b;
  --line: #e3e5e8;
  --paper: #ffffff;
  --soft: #f5f6f8;
  --shadow: 0 12px 32px rgba(30, 35, 45, .08);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  height: 68px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--miwe-yellow);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.app-shell {
  width: min(1120px, calc(100vw - 40px));
  margin: 30px auto 56px;
}

.stepper {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 34px;
  padding: 8px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  overflow-x: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(20, 20, 20, .05);
}

.step {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: #737780;
  white-space: nowrap;
  font-size: 14px;
}

.step + .step::before {
  content: "";
  width: 24px;
  height: 1px;
  background: #d8dbe0;
  margin-right: 2px;
}

.step b {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e5e7eb;
  color: #777;
  font-size: 13px;
}

.step.is-active {
  color: var(--blue);
}

.step.is-active b,
.step.is-done b {
  color: #fff;
  background: var(--blue);
}

.step.is-done b {
  background: var(--green);
}

.screen {
  display: none;
}

.screen.is-active {
  display: block;
}

.hero {
  padding: 72px min(8vw, 88px);
  background: var(--miwe-yellow);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.eyebrow {
  width: fit-content;
  display: inline-flex;
  gap: 9px;
  align-items: center;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .76);
  color: #4f4f4f;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.eyebrow span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: inset 0 0 0 4px #fff;
}

.hero h1 {
  max-width: 770px;
  margin: 32px 0 22px;
  font-size: clamp(42px, 6vw, 76px);
  line-height: .98;
  letter-spacing: 0;
}

.hero p {
  max-width: 760px;
  margin: 0;
  color: #34363b;
  font-size: 21px;
  line-height: 1.55;
}

.hero-actions,
.action-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-actions {
  margin-top: 36px;
}

.trust-row {
  margin-top: 46px;
  padding-top: 22px;
  border-top: 1px solid rgba(30, 30, 30, .14);
  display: flex;
  flex-wrap: wrap;
  gap: 20px 32px;
  color: #333;
}

.primary-button,
.secondary-button,
.ghost-button,
.link-button {
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 700;
}

.primary-button {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 8px 20px rgba(47, 98, 223, .22);
}

.primary-button:hover {
  background: var(--blue-dark);
}

.primary-button:disabled {
  background: #a8b9ef;
  cursor: not-allowed;
}

.secondary-button,
.ghost-button {
  color: var(--ink);
  background: #fff;
  border-color: #d7dae0;
}

.link-button {
  color: var(--blue);
  background: transparent;
  padding-inline: 8px;
}

.info-panel,
.section-card,
.result-card,
.done-card,
.test-card,
.technical-details {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.info-panel {
  margin: 22px 0 0;
  padding: 24px 28px;
}

.screen-head {
  text-align: center;
  margin-bottom: 30px;
}

.screen-head h1,
.section-head h1,
.done-card h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.08;
  letter-spacing: 0;
}

.screen-head p,
.section-head p,
.done-card p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.progress {
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: #e4e6ea;
  margin-bottom: 28px;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--blue);
  transition: width .3s ease;
}

.test-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.test-card {
  padding: 28px 30px 24px;
}

.test-card header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding-bottom: 22px;
  border-bottom: 1px solid #eef0f2;
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f4f5f6;
  color: #555;
  font-size: 20px;
}

.test-card h2 {
  margin: 0 0 5px;
  font-size: 18px;
}

.test-card p {
  margin: 0;
  color: #777c84;
}

.check-list {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
}

.check-list li {
  min-height: 48px;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px dashed #eceef1;
}

.check-list li:last-child {
  border-bottom: 0;
}

.status-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  color: #fff;
  font-weight: 900;
  background: #c8ccd2;
}

.status-ok .status-dot { background: var(--green); }
.status-warn .status-dot { background: var(--orange); }
.status-bad .status-dot { background: var(--red); }
.status-unclear .status-dot { background: var(--gray); }
.status-run .status-dot {
  border: 2px solid #cbd8ff;
  border-top-color: var(--blue);
  background: transparent;
  animation: spin 900ms linear infinite;
}

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

.check-value {
  color: #777;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
}

.result-card {
  padding: 54px min(6vw, 72px);
  display: grid;
  grid-template-columns: 106px 1fr;
  gap: 42px;
  align-items: center;
}

.traffic-light {
  width: 88px;
  height: 194px;
  padding: 16px;
  border-radius: 26px;
  background: #171717;
  display: grid;
  gap: 13px;
  box-shadow: 0 12px 22px rgba(0, 0, 0, .22);
}

.traffic-light span {
  border-radius: 50%;
  background: #4c4c4c;
}

.traffic-light[data-level="ok"] span:nth-child(3) { background: #b6e84b; box-shadow: 0 0 22px rgba(182, 232, 75, .65); }
.traffic-light[data-level="warn"] span:nth-child(2) { background: var(--orange); box-shadow: 0 0 22px rgba(255, 157, 40, .55); }
.traffic-light[data-level="bad"] span:nth-child(1) { background: #ff2525; box-shadow: 0 0 22px rgba(255, 37, 37, .55); }
.traffic-light[data-level="unclear"] span:nth-child(3) { background: #d7d7d7; box-shadow: 0 0 18px rgba(215, 215, 215, .4); }

.result-badge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 800;
  background: #eef6da;
  color: #537700;
}

.result-badge::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}

.result-card[data-level="warn"] .result-badge { background: #fff0dc; color: #b05b00; }
.result-card[data-level="bad"] .result-badge { background: #ffd9d9; color: #b00000; }
.result-card[data-level="unclear"] .result-badge { background: #ededed; color: #686868; }

.result-card h1 {
  margin: 18px 0 14px;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: 0;
}

.result-card p {
  margin: 0;
  color: #555962;
  font-size: 18px;
  line-height: 1.6;
}

.verdict-box {
  margin-top: 22px;
  padding: 16px 18px;
  border-radius: 8px;
  background: #f3f8e8;
  border: 1px solid #cde7a0;
  color: #4d7100;
}

.result-card[data-level="warn"] .verdict-box { background: #fff4e8; border-color: #ffc987; color: #9a4b00; }
.result-card[data-level="bad"] .verdict-box { background: #ffe0e0; border-color: #ffaaa7; color: #970000; }
.result-card[data-level="unclear"] .verdict-box { background: #f3f3f3; border-color: #d8d8d8; color: #555; }

#screen-result .action-row,
.technical-details {
  margin-top: 26px;
}

.technical-details {
  overflow: hidden;
}

.technical-details summary {
  padding: 18px 22px;
  font-weight: 800;
  cursor: pointer;
  background: #ececec;
}

.technical-details pre {
  margin: 0;
  padding: 18px 22px;
  overflow: auto;
  max-height: 420px;
  font-size: 13px;
}

.section-card {
  padding: 42px min(5vw, 56px);
}

.section-head {
  margin-bottom: 28px;
}

.os-box,
.upload-state,
.zip-summary,
.privacy-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 18px 0;
  background: #fafafa;
}

.script-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.script-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.script-card.is-recommended {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 98, 223, .12);
}

.script-card h3 {
  margin: 0 0 6px;
}

.script-card p {
  min-height: 46px;
  margin: 0 0 16px;
  color: var(--muted);
}

.drop-zone {
  min-height: 156px;
  border: 2px dashed #cdd2da;
  border-radius: 12px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  background: #fbfcfd;
  cursor: pointer;
}

.drop-zone.is-dragover {
  border-color: var(--blue);
  background: #eef3ff;
}

.drop-zone input {
  display: none;
}

.drop-zone strong,
.drop-zone small {
  display: block;
}

.drop-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef3ff;
  color: var(--blue);
  font-size: 25px;
  margin-bottom: 12px;
}

.report-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
}

.report-form label span {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.report-form small {
  color: #8a8f98;
  font-weight: 500;
}

.report-form input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid #d3d7de;
  border-radius: 8px;
  background: #fff;
}

.zip-summary ul,
.privacy-box ul {
  margin: 12px 0 0;
  padding-left: 20px;
}

.zip-summary li,
.privacy-box li {
  margin: 7px 0;
}

.consent {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 22px 0 28px;
}

.consent input {
  width: 22px;
  height: 22px;
}

.send-state {
  margin: 16px 0 0;
  color: var(--muted);
}

.done-card {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 64px 56px;
  text-align: center;
}

.done-mark {
  width: 96px;
  height: 96px;
  margin: 0 auto 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f0fadf;
  border: 1px solid #cdeaa0;
  color: #6c9600;
  font-size: 54px;
}

.done-card code {
  display: inline-block;
  margin: 26px 0 28px;
  padding: 16px 22px;
  border-radius: 8px;
  background: #171717;
  color: #fff;
  font-size: clamp(20px, 4vw, 30px);
  font-weight: 900;
}

.is-hidden {
  display: none !important;
}

.test-panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  width: 220px;
  padding: 12px;
  display: grid;
  gap: 8px;
  background: #171717;
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .24);
}

.test-panel strong {
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.test-panel button {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 7px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.test-panel button:hover {
  background: rgba(255, 255, 255, .16);
}

@media (max-width: 820px) {
  .topbar {
    padding: 0 16px;
  }

  .brand small,
  .ghost-button {
    display: none;
  }

  .app-shell {
    width: min(100vw - 24px, 1120px);
    margin-top: 18px;
  }

  .hero {
    padding: 42px 28px;
    border-radius: 18px;
  }

  .hero h1 {
    font-size: 42px;
  }

  .hero p {
    font-size: 18px;
  }

  .test-grid,
  .report-form,
  .script-grid,
  .result-card {
    grid-template-columns: 1fr;
  }

  .result-card {
    gap: 24px;
    padding: 34px 26px;
  }

  .traffic-light {
    width: 76px;
    height: 168px;
  }

  .test-panel {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    grid-template-columns: repeat(3, 1fr);
  }

  .test-panel strong {
    grid-column: 1 / -1;
  }
}
