/* ==========================================================================
   MiniApp «Рекрутинг 5.0» — design tokens (перенесены из ЛендингРекуритнг5.0
   для консистентности, см. ТЗ) + компоненты экранов
   ========================================================================== */

:root{
  --bg:#05070a;
  --panel:#0a0e14;
  --panel-2:#0d131c;
  --mint:#00f5a0;
  --blue:#3e8eff;
  --red:#ff5d5d;
  --text:#eef2f6;
  --text-muted:#97a1af;
  --text-tech:#5c6673;
  --border:#1a212c;

  --font-display:'Unbounded', 'Manrope', sans-serif;
  --font-body:'Manrope', sans-serif;
  --font-mono:'JetBrains Mono', monospace;

  --radius:14px;
  --radius-lg:20px;

  /* высота видимой области — переопределяется JS через Platform.onViewportChange */
  --app-height: 100vh;
}

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

html,body{ height:100%; }

body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:var(--font-body);
  font-size:16px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
  overscroll-behavior:none;
}

img,video{ max-width:100%; display:block; }
[hidden]{ display:none !important; }

h1,h2,h3,h4{
  font-family:var(--font-display);
  font-weight:600;
  line-height:1.2;
  margin:0 0 12px;
  letter-spacing:-0.01em;
}

p{ margin:0 0 12px; color:var(--text-muted); }
a{ color:var(--blue); text-decoration:none; }
ul{ list-style:none; margin:0; padding:0; }
button{ font-family:inherit; cursor:pointer; }

/* ---------- App shell ---------- */

#app{
  min-height: var(--app-height);
  display:flex;
  flex-direction:column;
}

.screen{
  flex:1;
  padding:20px 16px 100px;
  max-width:640px;
  margin:0 auto;
  width:100%;
}

.screen-title{
  font-size:22px;
  margin-bottom:8px;
}
.screen-subtitle{
  color:var(--text-muted);
  margin-bottom:24px;
}

.pill{
  display:inline-block;
  padding:4px 10px;
  border-radius:999px;
  background:var(--panel-2);
  border:1px solid var(--border);
  color:var(--text-tech);
  font-family:var(--font-mono);
  font-size:12px;
  margin-bottom:16px;
}

/* ---------- Cards ---------- */

.card{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px;
  margin-bottom:12px;
}

.card--clickable{ transition:border-color .15s ease, transform .1s ease; }
.card--clickable:active{ transform:scale(0.98); }
.card--clickable:hover{ border-color:var(--blue); }

.tool-card{
  display:flex;
  align-items:center;
  gap:12px;
}
.tool-card__badge{
  width:36px; height:36px;
  border-radius:10px;
  background:var(--panel-2);
  display:flex; align-items:center; justify-content:center;
  color:var(--mint);
  font-family:var(--font-mono);
  font-weight:600;
  flex-shrink:0;
}
.tool-card__body{ flex:1; min-width:0; }
.tool-card__title{ font-weight:600; margin-bottom:2px; }
.tool-card__meta{ font-size:13px; color:var(--text-tech); }

/* ---------- Tools grid ---------- */

.tools-grid{ display:grid; gap:10px; }

/* ---------- Detail overlay (tool video/text) ---------- */

.detail-overlay{
  position:fixed; inset:0;
  background:var(--bg);
  z-index:50;
  display:flex; flex-direction:column;
  overflow-y:auto;
}
.detail-overlay .screen{ padding-top:24px; }

.media-frame{
  position:relative;
  width:100%;
  aspect-ratio:16/9;
  background:var(--panel-2);
  border-radius:var(--radius);
  overflow:hidden;
  margin-bottom:16px;
  display:flex; align-items:center; justify-content:center;
}
.media-frame video{ width:100%; height:100%; object-fit:cover; }
.media-frame__placeholder{
  color:var(--text-tech);
  font-family:var(--font-mono);
  font-size:13px;
  text-align:center;
  padding:0 20px;
}

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

.btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:8px;
  padding:14px 20px;
  border-radius:var(--radius);
  border:1px solid var(--border);
  background:var(--panel-2);
  color:var(--text);
  font-weight:600;
  font-size:15px;
  width:100%;
}
.btn--primary{
  background:var(--mint);
  border-color:var(--mint);
  color:#04150e;
}
.btn--secondary{
  background:transparent;
  border-color:var(--border);
  color:var(--text);
}
.btn--ghost{
  background:transparent;
  border:none;
  color:var(--blue);
  width:auto;
  padding:8px 0;
}

/* Кастомная нижняя главная кнопка — используется на MAX/в браузере, где нет
   нативного Telegram MainButton (см. Skill_MiniApp, 4.2) */
.custom-main-button{
  position:fixed;
  left:16px; right:16px; bottom:16px;
  z-index:40;
}

/* ---------- Fork screen (Экран 5) ---------- */

.variant-card{
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:20px;
  margin-bottom:16px;
  background:var(--panel);
}
.variant-card--recommended{ border-color:var(--mint); }
.variant-card__badge{
  display:inline-block;
  background:var(--mint);
  color:#04150e;
  font-size:12px;
  font-weight:700;
  padding:3px 10px;
  border-radius:999px;
  margin-bottom:10px;
}
.variant-card__price{
  font-family:var(--font-display);
  font-size:28px;
  margin:8px 0 4px;
}
.variant-card__price-note{ color:var(--text-tech); font-size:13px; margin-bottom:12px; }
.variant-card ul{ margin-bottom:16px; }
.variant-card li{
  padding-left:20px;
  position:relative;
  margin-bottom:8px;
  color:var(--text-muted);
  font-size:14px;
}
.variant-card li::before{
  content:"—";
  position:absolute; left:0; color:var(--mint);
}

.compare-quote{
  border-left:2px solid var(--blue);
  padding-left:14px;
  color:var(--text-muted);
  font-size:14px;
  margin:16px 0;
}

/* ---------- Form (Экран 6 — анкета) ---------- */

.field{ margin-bottom:16px; }
.field label{
  display:block;
  font-size:13px;
  color:var(--text-tech);
  margin-bottom:6px;
  font-family:var(--font-mono);
}
.field input,.field textarea{
  width:100%;
  background:var(--panel-2);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:12px 14px;
  color:var(--text);
  font-family:inherit;
  font-size:15px;
}
.field textarea{ min-height:90px; resize:vertical; }

/* ---------- Checklist (Экран 7) ---------- */

.tabs{ display:flex; gap:8px; margin-bottom:20px; }
.tab{
  flex:1;
  text-align:center;
  padding:10px;
  border-radius:var(--radius);
  border:1px solid var(--border);
  background:var(--panel);
  color:var(--text-muted);
  font-weight:600;
  font-size:14px;
}
.tab.active{ background:var(--panel-2); color:var(--mint); border-color:var(--mint); }

.progress-bar{
  height:8px;
  border-radius:999px;
  background:var(--panel-2);
  overflow:hidden;
  margin-bottom:20px;
}
.progress-bar__fill{
  height:100%;
  background:linear-gradient(90deg,var(--blue),var(--mint));
  transition:width .3s ease;
}

.checklist-step{
  display:flex; align-items:flex-start; gap:12px;
  padding:12px 0;
  border-bottom:1px solid var(--border);
}
.checklist-step:last-child{ border-bottom:none; }
.checklist-step__dot{
  width:22px; height:22px;
  border-radius:50%;
  border:2px solid var(--border);
  flex-shrink:0;
  margin-top:2px;
  display:flex; align-items:center; justify-content:center;
  font-size:12px;
}
.checklist-step.done .checklist-step__dot{
  background:var(--mint);
  border-color:var(--mint);
  color:#04150e;
}
.checklist-step.current .checklist-step__dot{ border-color:var(--blue); }
.checklist-step__text{ color:var(--text); }
.checklist-step.done .checklist-step__text{ color:var(--text-muted); text-decoration:line-through; }

.current-step-banner{
  background:var(--panel-2);
  border:1px solid var(--blue);
  border-radius:var(--radius);
  padding:14px;
  margin-bottom:20px;
  font-size:14px;
}

/* ---------- Timeline (Экран 8) ---------- */

.timeline-step{
  display:flex; gap:14px;
  padding-bottom:24px;
  position:relative;
}
.timeline-step:not(:last-child)::before{
  content:"";
  position:absolute;
  left:10px; top:24px; bottom:0;
  width:2px;
  background:var(--border);
}
.timeline-step__marker{
  width:22px; height:22px;
  border-radius:50%;
  background:var(--panel-2);
  border:2px solid var(--border);
  flex-shrink:0;
  z-index:1;
}
.timeline-step.active .timeline-step__marker{ border-color:var(--mint); background:var(--mint); }
.timeline-step__time{
  font-family:var(--font-mono);
  font-size:12px;
  color:var(--text-tech);
  margin-bottom:4px;
}

/* ---------- Support link ---------- */

.support-fab{
  position:fixed;
  right:16px; bottom:16px;
  background:var(--panel-2);
  border:1px solid var(--border);
  border-radius:999px;
  padding:10px 16px;
  font-size:13px;
  color:var(--text);
  z-index:45;
  display:flex; align-items:center; gap:6px;
}

.placeholder-note{
  border:1px dashed var(--red);
  color:var(--red);
  border-radius:var(--radius);
  padding:12px;
  font-size:13px;
  font-family:var(--font-mono);
  margin-bottom:16px;
}

.nav-list{ display:grid; gap:10px; }
.nav-list .card{ display:flex; justify-content:space-between; align-items:center; }
