:root {
  --bg: #f7f5fa;
  --surface: #ffffff;
  --ink: #221b2a;
  --ink-soft: #6d6478;
  --line: #e8e2ef;
  --accent: #5c3a80;
  --accent-dark: #452a62;
  --accent-soft: #f3eef9;
  --gradient: linear-gradient(135deg, #4b2b69 0%, #6e4e92 100%);
  --ok: #2f7d5b;
  --no: #b5423b;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(34,27,42,.05), 0 8px 24px rgba(34,27,42,.06);
  --font: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* атрибут hidden должен побеждать display:flex/grid у компонентов */
[hidden] { display: none !important; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1 0 auto; }

.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 12px; }
h1 { font-size: clamp(30px, 5vw, 46px); font-weight: 700; }
h2 { font-size: clamp(23px, 3.2vw, 31px); font-weight: 700; }
h3 { font-size: 20px; font-weight: 650; }
p { margin: 0 0 12px; }
.accent { color: var(--accent); }
.sub { color: var(--ink-soft); margin-bottom: 24px; }
.micro { font-size: 13px; color: var(--ink-soft); margin: 10px 0 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- шапка ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 500; }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.topbar__actions { display: flex; align-items: center; gap: 12px; }

/* логотип DIONA: белая надпись на фиолетовой плашке, буква O — кольцо */
.logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.logo__badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gradient); border-radius: 12px; padding: 9px 16px;
}
.logo__word {
  display: inline-flex; align-items: center; gap: 3px;
  color: #fff; font-size: 19px; font-weight: 400; letter-spacing: .16em; line-height: 1;
}
.logo__o {
  display: inline-block; width: .78em; height: .78em; border: 1.8px solid currentColor;
  border-radius: 50%; margin: 0 .06em;
}
.logo__sub { color: var(--ink-soft); font-size: 14px; }

/* ---------- экраны ---------- */
.screen { display: none; padding: 44px 0 64px; }
.screen.is-active { display: block; animation: fade .25s ease both; }
.screen--center { min-height: 58vh; display: none; place-items: center; }
.screen--center.is-active { display: grid; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hero { max-width: 700px; margin-bottom: 34px; }
.eyebrow {
  display: inline-block; background: var(--accent-soft); color: var(--accent);
  font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px; margin-bottom: 16px;
}
.lead { font-size: 18px; color: var(--ink-soft); }

.backlink {
  background: none; border: 0; color: var(--ink-soft); font: inherit; font-size: 15px;
  cursor: pointer; padding: 6px 0; margin-bottom: 12px;
}
.backlink:hover { color: var(--accent); }
.backlink--sm { font-size: 14px; margin: 14px 0 0; display: inline-block; }

/* ---------- сетка и карточки ---------- */
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; text-align: left; font: inherit; color: inherit; cursor: pointer;
  display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 10px 30px rgba(92,58,128,.14); }
.card__title { font-size: 20px; font-weight: 650; }
.card__desc { color: var(--ink-soft); font-size: 15px; }
.card__cta { color: var(--accent); font-weight: 600; margin-top: 6px; font-size: 15px; }
.card__cta--muted { color: var(--ink-soft); }
.card.is-disabled { cursor: not-allowed; opacity: .62; box-shadow: none; background: #fbfafc; }
.card.is-disabled:hover { transform: none; border-color: var(--line); box-shadow: none; }
.fork .card { padding: 30px; }

/* ---------- как это работает ---------- */
.howto { margin-top: 56px; }
.howto__title { font-size: 20px; font-weight: 650; margin-bottom: 18px; }
.howto__list {
  list-style: none; counter-reset: step; margin: 0; padding: 0;
  display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.howto__list li {
  counter-increment: step; position: relative;
  padding: 20px 20px 20px 60px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 3px;
}
.howto__list li::before {
  content: counter(step); position: absolute; left: 20px; top: 20px;
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px;
}
.howto__list b { font-size: 16px; }
.howto__list span { color: var(--ink-soft); font-size: 14px; }

/* ---------- языковой переключатель ---------- */
.langswitch { display: inline-flex; background: #f1edf6; border-radius: 999px; padding: 3px; }
.langswitch__btn {
  border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-soft);
  padding: 6px 13px; border-radius: 999px; cursor: pointer;
}
.langswitch__btn.is-active { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(34,27,42,.1); }

/* ---------- шаги ---------- */
.steps { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.steps__item {
  font-size: 13px; font-weight: 600; color: var(--ink-soft);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px;
}
.steps__item.is-current { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.steps__item.is-done { color: var(--ok); border-color: #cfe6da; background: #f0f8f4; }

/* ---------- карточка вакансии ---------- */
.vacancy {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 22px; margin-bottom: 22px; box-shadow: var(--shadow);
}
.vacancy__duties > span { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.vacancy__duties ul { margin: 8px 0 0; padding-left: 18px; color: var(--ink-soft); font-size: 15px; }
.vacancy__duties li { margin-bottom: 3px; }

/* ---------- города ---------- */
.citytabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.citytab {
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 15px;
  display: inline-flex; align-items: center; gap: 7px; transition: all .15s ease;
}
.citytab span { font-size: 12px; font-weight: 600; color: var(--ink-soft); background: #f1edf6; border-radius: 999px; padding: 1px 7px; }
.citytab:hover { border-color: var(--accent); }
.citytab.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.citytab.is-active span { background: rgba(255,255,255,.22); color: #fff; }

/* ---------- карта ---------- */
.maplayout { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.map { height: 520px; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); z-index: 1; overflow: hidden; }
.mapnote { font-size: 13px; color: var(--ink-soft); margin: 8px 2px 0; }
.storepanel { display: grid; gap: 10px; }
.storesearch {
  font: inherit; font-size: 15px; padding: 12px 14px; width: 100%;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}
.storesearch:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.storelist { max-height: 462px; overflow-y: auto; display: grid; gap: 8px; padding-right: 4px; }
.storelist__empty { font-size: 14px; color: var(--ink-soft); margin: 0; }
.storeitem {
  text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  transition: border-color .15s ease, background .15s ease;
}
.storeitem:hover { border-color: var(--accent); }
.storeitem.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.storeitem b { display: block; font-size: 15px; }
.storeitem span { color: var(--ink-soft); font-size: 13px; }

.pin {
  width: 30px; height: 30px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg);
  background: var(--accent); border: 2px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,.25);
  cursor: pointer;
}
.pin.is-selected { background: var(--ink); z-index: 10; }
.cluster {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(92,58,128,.92); color: #fff; font-weight: 700; font-size: 14px;
  border: 3px solid rgba(255,255,255,.85); box-shadow: 0 3px 10px rgba(0,0,0,.2);
}
.leaflet-popup-content { font-family: var(--font); margin: 12px 14px; }
.leaflet-popup-content b { display: block; margin-bottom: 2px; }
.popup span { color: var(--ink-soft); font-size: 13px; }
.popup__btn {
  margin-top: 8px; background: var(--accent); color: #fff; border: 0; border-radius: 8px;
  padding: 8px 13px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.popup__btn:hover { background: var(--accent-dark); }

/* ---------- анкета ---------- */
.panel {
  margin-top: 24px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.panel.is-locked { background: #faf9fc; border-style: dashed; box-shadow: none; }
.panel__lock { padding: 26px; color: var(--ink-soft); }
.panel__lock b { color: var(--ink); display: block; }
.panel__lock p { margin: 2px 0 0; font-size: 14px; }
.panel__body { padding: 26px; }

.chosen {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 22px;
  padding-bottom: 18px; border-bottom: 1px solid var(--line);
}
.chip { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 600; }
.chip--muted { background: #f2f0f5; color: var(--ink-soft); }
.chip--change {
  background: none; border: 1px solid var(--line); color: var(--ink-soft); cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; border-radius: 999px; padding: 6px 13px;
}
.chip--change:hover { border-color: var(--accent); color: var(--accent); }

.progress { height: 6px; background: #efeaf4; border-radius: 999px; overflow: hidden; }
.progress__bar { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s ease; }
.progress__label { font-size: 13px; color: var(--ink-soft); margin: 8px 0 22px; }

.question { animation: fade .2s ease both; }
.hint { color: var(--ink-soft); font-size: 15px; }
.answers { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }

.btn {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 12px;
  padding: 13px 24px; border: 1px solid transparent; transition: all .15s ease;
}
.btn--sm { padding: 8px 14px; font-size: 14px; }
.btn--wide { width: 100%; margin-top: 10px; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); }
.btn--primary:disabled { opacity: .6; cursor: progress; }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--yes, .btn--no { background: #fff; border-color: var(--line); color: var(--ink); min-width: 132px; }
.btn--yes:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn--no:hover { border-color: var(--no); color: var(--no); background: #fdf4f3; }

.fields { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 18px 0 4px; }
.fields__full { grid-column: 1 / -1; }
.fields label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.fields input, .fields textarea {
  font: inherit; font-weight: 400; color: var(--ink); padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; width: 100%;
}
.fields input:focus, .fields textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.formerror { color: var(--no); font-size: 14px; margin: 12px 0 0; }

/* поле-ловушка для спам-ботов */
.honey { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- результаты ---------- */
.result {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 42px; max-width: 620px; text-align: center; box-shadow: var(--shadow);
}
.result__lead { font-size: 20px; font-weight: 600; }
.result__text { color: var(--ink-soft); }
.result__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.result--ok h2 { color: var(--accent); }

.letter {
  text-align: left; background: #fbfafc; border: 1px solid var(--line); border-radius: 12px;
  padding: 18px; margin: 22px 0; font-size: 14px; color: var(--ink-soft);
}
.letter b { color: var(--ink); }

/* ---------- подвал ---------- */
.footer { flex-shrink: 0; border-top: 1px solid var(--line); background: var(--surface); padding: 22px 0; }
.footer p { margin: 0; color: var(--ink-soft); font-size: 14px; }

@media (max-width: 860px) {
  .maplayout { grid-template-columns: 1fr; }
  .map { height: 360px; }
  .storelist { max-height: 280px; }
  .result { padding: 28px 20px; }
  .btn--yes, .btn--no { flex: 1; min-width: 0; }
  .screen { padding: 28px 0 48px; }
}
