/* GMONIT — викторина «Observability Day 26». Mobile-first.
   Палитра/типографика из дизайн-системы GMONIT (design-system.css). */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --navy: #0C1249;
  --accent: #0066FF;
  --accent-2: #4D8BFF;
  --body: #2A3060;
  --subtle: #5A6180;
  --muted: #8890A8;
  --bg: #E6EBF5;
  --card-border: #E4E8F2;
  --green: #2E7D32;
  --red: #EF3124;
  --green-bg: #F4FBF4;
  --green-bd: #C8E6C8;
  --red-bg: #FFF6F6;
  --red-bd: #FFD4D4;
  --blue-bg: #F2F6FF;
  --blue-bd: #CCDAFF;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: 'Manrope', sans-serif;
  background: var(--bg);
  color: var(--navy);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 16px 16px 28px;
}

/* ─── Шапка ─── */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 2px 14px;
}
.topbar .brand {
  font-weight: 800;
  letter-spacing: 2px;
  font-size: 14px;
  color: var(--navy);
}
.topbar .brand b { color: var(--accent); }
.topbar .ev {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--navy);
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: .3px;
}

/* ─── Экраны ─── */
.screen { display: none; flex: 1; flex-direction: column; }
body[data-screen="welcome"]   .screen.welcome,
body[data-screen="quiz"]      .screen.quiz,
body[data-screen="result"]    .screen.result,
body[data-screen="already"]   .screen.already,
body[data-screen="error"]     .screen.error { display: flex; }

/* ─── Карточка-контейнер ─── */
.card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 22px 20px;
  box-shadow: 0 2px 16px rgba(10,16,69,.05);
}

h1 { font-size: 24px; font-weight: 800; line-height: 1.2; margin-bottom: 8px; }
h2 { font-size: 20px; font-weight: 800; line-height: 1.25; }
.lead { font-size: 14px; color: var(--subtle); margin-bottom: 18px; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.6; }

/* ─── Welcome форма ─── */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.field input {
  width: 100%;
  font-family: inherit;
  font-size: 16px; /* >=16 чтобы iOS не зумил */
  color: var(--navy);
  background: #fff;
  border: 1.5px solid var(--card-border);
  border-radius: 12px;
  padding: 13px 14px;
  outline: none;
  transition: border-color .15s;
}
.field input:focus { border-color: var(--accent); }
.field .err { display: none; font-size: 12px; color: var(--red); margin-top: 5px; font-weight: 600; }
.field.invalid input { border-color: var(--red); }
.field.invalid .err { display: block; }

/* ─── Кнопки ─── */
.btn {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  padding: 15px;
  cursor: pointer;
  min-height: 52px;
  transition: filter .15s, opacity .15s;
}
.btn:active { filter: brightness(.93); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.secondary { background: #fff; color: var(--navy); border: 1.5px solid var(--card-border); }

/* ─── Quiz ─── */
.progress-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.progress-head .step { font-size: 13px; font-weight: 700; color: var(--subtle); }
.chip {
  display: inline-block;
  font-size: 10px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
  color: var(--accent); background: var(--blue-bg); border: 1px solid var(--blue-bd);
  padding: 4px 11px; border-radius: 20px;
}
.bar { height: 6px; background: #fff; border: 1px solid var(--card-border); border-radius: 20px; overflow: hidden; margin-bottom: 18px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 20px; transition: width .25s ease; }

.q-text { font-size: 18px; font-weight: 800; line-height: 1.35; margin: 14px 0 16px; }

.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  font-family: inherit; font-size: 15px; font-weight: 600; color: var(--body);
  background: #fff; border: 1.5px solid var(--card-border); border-radius: 14px;
  padding: 15px 14px; min-height: 56px; cursor: pointer;
  transition: border-color .12s, background .12s;
}
.option .mark {
  flex: 0 0 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--card-border); display: grid; place-items: center;
  font-size: 12px; font-weight: 800; color: var(--muted); transition: all .12s;
}
.option.selected { border-color: var(--accent); background: var(--blue-bg); }
.option.selected .mark { border-color: var(--accent); background: var(--accent); color: #fff; }

.sticky-cta { margin-top: auto; padding-top: 18px; position: sticky; bottom: 0; }

/* ─── Result ─── */
.score-hero { text-align: center; padding: 8px 0 4px; }
.score-big { font-size: 60px; font-weight: 800; color: var(--accent); line-height: 1; }
.score-big small { font-size: 26px; color: var(--muted); font-weight: 700; }
.tier-msg { font-size: 16px; font-weight: 700; color: var(--navy); margin-top: 10px; }
.tier-sub { font-size: 13px; color: var(--subtle); margin-top: 4px; }

.review { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.review-item { border-radius: 14px; padding: 14px 15px; border: 1px solid var(--card-border); background: #fff; }
.review-item .rq { font-size: 14px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.review-item .ra { font-size: 13px; line-height: 1.6; }
.review-item .ra .lab { font-weight: 700; }
.review-item.ok  { background: var(--green-bg); border-color: var(--green-bd); }
.review-item.bad { background: var(--red-bg); border-color: var(--red-bd); }
.review-item.ok .verdict  { color: var(--green); font-weight: 800; }
.review-item.bad .verdict { color: var(--red); font-weight: 800; }
.review-item .your.wrong { color: var(--red); }
.review-item .correct { color: var(--green); }
.review-item .expl { font-size: 12.5px; color: var(--subtle); margin-top: 6px; font-style: italic; }

.foot-note { text-align: center; font-size: 12px; color: var(--muted); margin-top: 20px; }

.spacer { height: 14px; }
.center { text-align: center; }
.mt-auto { margin-top: auto; }
