/* MisViga – mobile-first styles. No external fonts or assets. */

:root {
  --ink: #0b1530;
  --ink-2: #1c2852;
  --ink-soft: #46506e;
  --cobalt: #2a55ff;
  --cobalt-dark: #1a3fd8;
  --cobalt-tint: #eef2ff;
  --white: #ffffff;
  --paper: #f5f7fc;
  --line: #d6dcec;
  --ok: #0f7a4a;
  --ok-tint: #e7f6ee;
  --warn: #8a5a00;
  --warn-tint: #fff5dc;
  --stop: #b3261e;
  --stop-tint: #fdecea;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(11, 21, 48, .06), 0 8px 24px rgba(11, 21, 48, .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap { width: 100%; max-width: 46rem; margin: 0 auto; padding: 0 1.125rem; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.6rem, 5vw, 2.3rem); font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 800; }
h3 { font-size: 1.08rem; font-weight: 700; }
p { margin: 0 0 1em; }
ul { margin: 0 0 1em; padding-left: 1.25em; }
li { margin-bottom: .35em; }
h1:focus, main:focus { outline: none; }

a { color: var(--cobalt-dark); }

:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: absolute; left: .5rem; top: -3rem; z-index: 10;
  background: var(--white); color: var(--ink); padding: .5rem .75rem; border-radius: 8px;
}
.skip-link:focus { top: .5rem; }

/* Header & footer ------------------------------------------------------- */

.site-header { background: var(--ink); color: var(--white); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 3.5rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--white); text-decoration: none; }
.brand-mark {
  display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 9px;
  background: var(--cobalt); font-weight: 900; font-size: .95rem;
}
.brand-name { font-weight: 900; font-size: 1.25rem; letter-spacing: -0.02em; }
.header-tag { font-size: .85rem; color: #c3cbe6; }

main { flex: 1; padding-top: 1.25rem; padding-bottom: 2.5rem; }

.site-footer { background: var(--ink); color: #c3cbe6; font-size: .9rem; padding: 1.25rem 0 1.5rem; }
.footer-disclaimer { margin-bottom: .5rem; }
.powered { margin: 0; font-size: .8rem; opacity: .8; }
.powered strong { color: var(--white); font-weight: 700; }

/* Hero ------------------------------------------------------------------- */

.hero {
  background: var(--ink); color: var(--white);
  border-radius: var(--radius); padding: 1.75rem 1.25rem 1.5rem; margin-bottom: 1.25rem;
  background-image: radial-gradient(120% 90% at 100% 0%, rgba(42, 85, 255, .55) 0%, rgba(42, 85, 255, 0) 60%);
}
.hero .eyebrow { color: #aebcff; font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .5rem; }
.hero h1 { font-size: clamp(1.9rem, 7vw, 2.8rem); }
.hero p { color: #dbe1f5; font-size: 1.08rem; }

.features { display: grid; gap: .75rem; margin: 0 0 1.25rem; padding: 0; list-style: none; }
.features li {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .9rem 1rem; margin: 0;
}
.features strong { display: block; }

/* Cards & layout --------------------------------------------------------- */

.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; margin-bottom: 1rem; box-shadow: var(--shadow);
}
.card > :last-child { margin-bottom: 0; }

.step-label { font-size: .85rem; font-weight: 700; color: var(--cobalt-dark); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .35rem; }

progress.progress {
  display: block; width: 100%; height: 8px; margin-bottom: 1.1rem; border: 0; border-radius: 99px;
  background: var(--line); color: var(--cobalt); appearance: none; -webkit-appearance: none; overflow: hidden;
}
progress.progress::-webkit-progress-bar { background: var(--line); border-radius: 99px; }
progress.progress::-webkit-progress-value { background: var(--cobalt); border-radius: 99px; }
progress.progress::-moz-progress-bar { background: var(--cobalt); border-radius: 99px; }

.muted { color: var(--ink-soft); }
.small { font-size: .9rem; }

.notice {
  background: var(--cobalt-tint); border-left: 4px solid var(--cobalt);
  border-radius: var(--radius-sm); padding: .85rem 1rem; margin-bottom: 1rem;
}
.notice > :last-child { margin-bottom: 0; }

.safe-rules { background: var(--paper); border-radius: var(--radius-sm); padding: .75rem 1rem; font-size: .92rem; margin-top: 1rem; }
.safe-rules ul { margin: .25rem 0 0; }

/* Forms ------------------------------------------------------------------ */

fieldset { border: 0; padding: 0; margin: 0 0 1.25rem; min-width: 0; }
legend { font-weight: 800; font-size: 1.12rem; padding: 0; margin-bottom: .35rem; }
.field-help { color: var(--ink-soft); font-size: .93rem; margin: 0 0 .75rem; }

.options { display: grid; gap: .6rem; }
.option {
  position: relative; display: flex; align-items: flex-start; gap: .75rem;
  background: var(--white); border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: .85rem 1rem; cursor: pointer; min-height: 3.25rem;
  transition: border-color .12s ease, background-color .12s ease;
}
.option:hover { border-color: #9fb0ec; }
.option input { width: 1.25rem; height: 1.25rem; margin: .15rem 0 0; accent-color: var(--cobalt); flex: none; }
.option:has(input:checked) { border-color: var(--cobalt); background: var(--cobalt-tint); }
.option:has(input:focus-visible) { outline: 3px solid var(--cobalt); outline-offset: 2px; }
.option-text strong { display: block; font-weight: 700; }
.option-text span { display: block; color: var(--ink-soft); font-size: .92rem; }
.option.is-unknown { border-style: dashed; }

.options.two-col { grid-template-columns: 1fr; }

label.field-label { display: block; font-weight: 700; margin-bottom: .35rem; }
input[type="text"], input[type="number"], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--white);
  border: 2px solid var(--line); border-radius: var(--radius-sm); padding: .7rem .8rem; min-height: 3rem;
}
input[type="text"]:focus, input[type="number"]:focus, select:focus, textarea:focus { border-color: var(--cobalt); }
textarea { min-height: 6rem; resize: vertical; }
.field { margin-bottom: 1.1rem; }
.check { display: flex; align-items: center; gap: .55rem; margin-top: .5rem; cursor: pointer; }
.check input { width: 1.2rem; height: 1.2rem; accent-color: var(--cobalt); }

.error-text { color: var(--stop); font-weight: 700; margin: .5rem 0 0; }

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

.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 800; border-radius: 999px; border: 2px solid transparent;
  padding: .8rem 1.4rem; min-height: 3rem; cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--cobalt); color: var(--white); }
.btn-primary:hover { background: var(--cobalt-dark); }
.btn-secondary { background: var(--white); color: var(--ink); border-color: var(--ink); }
.btn-secondary:hover { background: var(--paper); }
.btn-ghost { background: transparent; color: var(--cobalt-dark); padding-left: .4rem; padding-right: .4rem; text-decoration: underline; }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-wide { width: 100%; }
.hero .btn-primary { margin-top: .5rem; }

/* Photo placeholder ------------------------------------------------------ */

.photo-placeholder {
  border: 2px dashed var(--line); border-radius: var(--radius-sm); padding: 1rem;
  display: flex; gap: .9rem; align-items: flex-start; background: var(--paper);
}
.photo-icon {
  flex: none; width: 2.75rem; height: 2.75rem; border-radius: 10px; display: grid; place-items: center;
  background: var(--line); color: var(--ink-soft); font-weight: 900;
}
.badge {
  display: inline-block; font-size: .78rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  border-radius: 99px; padding: .15rem .6rem; background: var(--line); color: var(--ink);
}

/* Results ---------------------------------------------------------------- */

.safety { border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1rem; border: 2px solid; }
.safety h2 { margin-bottom: .4rem; }
.safety-ok { background: var(--ok-tint); border-color: var(--ok); }
.safety-ok .safety-level { color: var(--ok); }
.safety-caution { background: var(--warn-tint); border-color: #d9a400; }
.safety-caution .safety-level { color: var(--warn); }
.safety-stop { background: var(--stop-tint); border-color: var(--stop); }
.safety-stop .safety-level { color: var(--stop); }
.safety-level { font-weight: 900; text-transform: uppercase; letter-spacing: .06em; font-size: .85rem; }
.safety ol, .safety ul { margin-bottom: .5rem; }

.cause { border-left: 5px solid var(--line); }
.cause.rank-1 { border-left-color: var(--cobalt); }
.cause-head { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
.cause-rank { font-size: .82rem; font-weight: 800; color: var(--cobalt-dark); text-transform: uppercase; letter-spacing: .05em; }
.evidence { display: grid; gap: .5rem; margin: .75rem 0; }
.evidence h4 { margin: 0 0 .2rem; font-size: .9rem; }
.evidence ul { margin: 0; font-size: .95rem; }
.ev-for h4 { color: var(--ok); }
.ev-against h4 { color: var(--stop); }
.cost-line { font-weight: 700; }

.conf-pill {
  display: inline-block; font-weight: 900; border-radius: 99px; padding: .2rem .75rem;
  background: var(--ink); color: var(--white); font-size: .9rem;
}

.decision {
  background: var(--ink); color: var(--white); border: 0;
}
.decision h2 { color: var(--white); }
.decision .decision-title { font-size: 1.35rem; font-weight: 900; color: #aebcff; margin-bottom: .5rem; }
.decision ol { color: #dbe1f5; }
.decision label { color: var(--white); }
.decision input[type="number"] { max-width: 10rem; }
.decision .muted { color: #b9c3e3; }

.feedback-status { margin-top: 1rem; }
.status-ok { background: var(--ok-tint); border-left: 4px solid var(--ok); padding: .85rem 1rem; border-radius: var(--radius-sm); }
.status-error { background: var(--stop-tint); border-left: 4px solid var(--stop); padding: .85rem 1rem; border-radius: var(--radius-sm); }

/* Wider screens ---------------------------------------------------------- */

@media (min-width: 640px) {
  .wrap { padding: 0 1.5rem; }
  main { padding-top: 2rem; }
  .hero { padding: 2.5rem 2.25rem 2.25rem; }
  .card { padding: 1.6rem 1.75rem; }
  .features { grid-template-columns: repeat(3, 1fr); }
  .options.two-col { grid-template-columns: 1fr 1fr; }
  .evidence { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

@media (forced-colors: active) {
  .option:has(input:checked) { outline: 3px solid CanvasText; }
}
