:root {
  --ink: #012e2c;
  --teal: #014f4c;
  --mint: #1ed7aa;
  --sand: #f4f1e8;
  --paper: #fffdf8;
  --line: #d7cfc0;
  --danger: #c0392b;
  --ok: #0b7a4b;
  --shadow: 0 12px 40px rgba(1, 47, 45, 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(30, 215, 170, 0.18), transparent 50%),
    linear-gradient(180deg, #e8f3f0 0%, var(--sand) 40%, #efe7d6 100%);
  color: var(--ink);
  line-height: 1.5;
}

#app { max-width: 760px; margin: 0 auto; padding: 20px 16px 64px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--teal); color: white; display: grid; place-items: center;
  font-weight: 800; letter-spacing: 0.04em;
}
.brand h1 { font-size: 1.05rem; margin: 0; }
.brand p { margin: 0; font-size: 0.78rem; color: #3d5e5b; }

.progress {
  height: 8px; background: #dce8e4; border-radius: 99px; overflow: hidden; margin: 8px 0 20px;
}
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--mint)); }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 20px;
  box-shadow: var(--shadow);
}

h2 { margin: 0 0 8px; font-size: 1.45rem; }
.lede { color: #3d5e5b; margin: 0 0 16px; }
.kicker {
  display: inline-block; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--teal); font-weight: 700; margin-bottom: 6px;
}

.flow {
  display: grid; gap: 8px; margin: 16px 0;
}
.flow-step {
  display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: start;
  background: #f3faf7; border: 1px solid #cfe7dc; border-radius: 12px; padding: 10px 12px;
}
.flow-step b { color: white; background: var(--teal); width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 0.85rem; }
.flow-step.compare { background: #fff6e8; border-color: #ead7b0; }
.flow-step.compare b { background: #a15c12; }

ul.rules { padding-left: 18px; margin: 8px 0 0; }
ul.rules li { margin: 8px 0; }
.danger { color: var(--danger); font-weight: 700; }
.callout {
  background: #eef8f4; border-left: 4px solid var(--mint); padding: 12px 14px; border-radius: 10px; margin: 14px 0;
}
.callout.warn { background: #fff1e8; border-left-color: #e67e22; }
.callout.alert { background: #fdecea; border-left-color: var(--danger); }

.example {
  display: grid; gap: 8px; margin: 14px 0;
  background: #faf7f0; border-radius: 12px; padding: 12px; border: 1px dashed var(--line);
}
.row { display: flex; justify-content: space-between; gap: 8px; font-variant-numeric: tabular-nums; }
.row.bad { color: var(--danger); }
.row.good { color: var(--ok); }

.quiz { margin-top: 18px; }
.q { font-weight: 700; margin: 0 0 10px; }
.options { display: grid; gap: 8px; }
.opt {
  text-align: left; width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: white; cursor: pointer; font-size: 0.95rem;
}
.opt:hover { border-color: var(--teal); }
.opt.correct { background: #e7f7ee; border-color: var(--ok); }
.opt.wrong { background: #fdecea; border-color: var(--danger); }
.feedback { margin-top: 10px; font-weight: 600; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
button.primary, button.ghost, a.primary {
  border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 700; cursor: pointer;
  text-decoration: none; display: inline-block;
}
button.primary, a.primary { background: var(--teal); color: white; }
button.ghost { background: transparent; border: 1px solid var(--teal); color: var(--teal); }
button:disabled { opacity: 0.45; cursor: not-allowed; }

label { display: block; font-size: 0.85rem; font-weight: 700; margin: 12px 0 6px; }
input[type="text"] {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  font-size: 1rem; background: white;
}

.modules { display: grid; gap: 10px; }
.mod {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: white;
}
.mod.done { border-color: var(--ok); }
.pill { font-size: 0.75rem; font-weight: 700; color: var(--teal); }

.certificate {
  background: white;
  border: 10px solid var(--teal);
  outline: 2px solid var(--mint);
  outline-offset: -16px;
  padding: 28px 22px 22px;
  text-align: center;
  color: var(--ink);
}
.certificate .seal {
  width: 72px; height: 72px; margin: 0 auto 8px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--mint), var(--teal));
  color: white; display: grid; place-items: center; font-weight: 800;
}
.certificate h3 { margin: 6px 0 0; font-size: 1.15rem; letter-spacing: 0.08em; text-transform: uppercase; }
.certificate .who { font-size: 1.7rem; margin: 8px 0; font-family: Georgia, "Times New Roman", serif; }
.certificate .meta { font-size: 0.85rem; color: #3d5e5b; }
.cert-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }

.score { font-size: 1.1rem; font-weight: 700; }

@media print {
  body { background: white; }
  .topbar, .progress, .actions, .cert-actions, .lede { display: none !important; }
  #app { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; }
}
