/* TRIDAY Анкета — стили */
:root {
  --bg: #0b1020;
  --bg2: #10173a;
  --card: #161d3f;
  --card2: #1c2450;
  --stroke: #2a3368;
  --text: #f3f5ff;
  --muted: #9aa3d1;
  --accent: #5b8cff;
  --accent2: #7c5bff;
  --accent-soft: rgba(91, 140, 255, 0.14);
  --ok: #2fd481;
  --err: #ff5b6e;
  --radius: 18px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

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

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

body {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1200px 800px at 85% -10%, rgba(124, 91, 255, 0.25), transparent 60%),
    radial-gradient(1000px 700px at -10% 20%, rgba(91, 140, 255, 0.18), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg2) 60%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
}

.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(11, 16, 32, 0.75);
  border-bottom: 1px solid rgba(42, 51, 104, 0.6);
}
.bar-in {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-top: 12px; padding-bottom: 12px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: 0.02em;
}
.logo svg { color: var(--accent); flex: none; }
.logo b { color: var(--muted); font-weight: 600; }

.progress-wrap { display: flex; align-items: center; gap: 12px; min-width: 160px; }
.progress-bar {
  flex: 1; height: 8px; border-radius: 99px; background: var(--stroke); overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 99px; transition: width 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.progress-text { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* ---------- Card ---------- */
main.wrap { padding-top: 28px; padding-bottom: 48px; }

.form-card {
  background: linear-gradient(180deg, var(--card), var(--card2));
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

.step { display: none; animation: fadeUp 0.35s ease both; }
.step.active { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.step-head { margin-bottom: 26px; }
.chip {
  display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent);
  background: var(--accent-soft); border: 1px solid rgba(91, 140, 255, 0.35);
  padding: 6px 14px; border-radius: 99px; margin-bottom: 12px;
}
h1 { font-size: clamp(26px, 4vw, 34px); font-weight: 800; letter-spacing: -0.01em; }
.step-head p { color: var(--muted); margin-top: 6px; font-size: 17px; }

/* ---------- Fields ---------- */
.field { display: block; margin-bottom: 24px; }
.field-label {
  display: block; font-size: 15px; font-weight: 600; color: var(--text);
  margin-bottom: 10px;
}
.field-label em { color: var(--err); font-style: normal; }

input[type="text"], input[type="tel"], input[type="email"], textarea {
  width: 100%;
  font: inherit; font-size: 17px;
  color: var(--text);
  background: rgba(11, 16, 32, 0.55);
  border: 1.5px solid var(--stroke);
  border-radius: 14px;
  padding: 16px 18px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
textarea { resize: vertical; min-height: 90px; }

input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.18);
}
input::placeholder, textarea::placeholder { color: #98a1c9; opacity: 1; }

.field.invalid input, .field.invalid textarea {
  border-color: var(--err);
  box-shadow: 0 0 0 4px rgba(255, 91, 110, 0.14);
}

.mt { margin-top: 12px; display: block; }

/* Segmented (Да/Нет) */
.seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  display: flex; align-items: center; justify-content: center;
  padding: 14px; border-radius: 14px; font-size: 17px; font-weight: 600;
  background: rgba(11, 16, 32, 0.55); border: 1.5px solid var(--stroke);
  color: var(--muted); cursor: pointer; user-select: none;
  transition: all 0.18s;
}
.seg input:checked + label {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: transparent; color: #fff;
  box-shadow: 0 6px 18px rgba(91, 140, 255, 0.35);
}
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Option chips ---------- */
.opts { display: grid; gap: 10px; }
.opts-multi { grid-template-columns: repeat(2, 1fr); }
.opts-single { grid-template-columns: repeat(2, 1fr); }

.opt { position: relative; display: flex; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt span {
  flex: 1;
  display: flex; align-items: center; gap: 12px;
  padding: 15px 16px;
  border-radius: 14px;
  background: rgba(11, 16, 32, 0.55);
  border: 1.5px solid var(--stroke);
  color: var(--muted);
  font-size: 16px; font-weight: 500;
  cursor: pointer; user-select: none;
  transition: all 0.16s ease;
  min-height: 54px;
}
.opt span::before {
  content: "";
  width: 26px; height: 26px; flex: none;
  border-radius: 8px;
  border: 2px solid #4a5590;
  background: rgba(11, 16, 32, 0.8);
  transition: all 0.16s;
}
.opts-single .opt span::before { border-radius: 99px; }

.opt input:checked + span {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}
.opt input:checked + span::before {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 6L9 17l-5-5' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 16px 16px;
  background-position: center;
  background-repeat: no-repeat;
}
.opts-single .opt input:checked + span::before { background-size: 0; }
.opts-single .opt input:checked + span::before {
  box-shadow: inset 0 0 0 4px var(--bg);
  background: var(--accent);
}

.opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt:hover span { border-color: #3a457f; color: var(--text); }

/* ---------- Feature blocks ---------- */
.features { display: grid; gap: 16px; }
.feature-block {
  background: rgba(11, 16, 32, 0.4);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  overflow: hidden;
}
.feature-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: rgba(91, 140, 255, 0.08);
  border-bottom: 1px solid var(--stroke);
  cursor: pointer; user-select: none;
}
.feature-head h3 { font-size: 17px; font-weight: 700; }
.feature-head .cnt {
  font-size: 13px; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); padding: 4px 10px; border-radius: 99px;
  display: none;
}
.feature-block.has-checks .cnt { display: inline-block; }
.feature-body { display: none; padding: 14px 18px 18px; }
.feature-block.open .feature-body { display: block; }
.feature-block .chev { transition: transform 0.25s; color: var(--muted); }
.feature-block.open .chev { transform: rotate(180deg); }

.feature-items { display: grid; grid-template-columns: 1fr; gap: 8px; }
.feature-items .opt span { min-height: 46px; padding: 11px 14px; font-size: 15px; }

/* ---------- Priorities ---------- */
.priorities { display: grid; gap: 10px; }
.prio-row {
  display: flex; align-items: center; gap: 12px;
  background: rgba(11, 16, 32, 0.55);
  border: 1.5px solid var(--stroke);
  border-radius: 14px;
  padding: 8px 8px 8px 16px;
}
.prio-row.dragover { border-color: var(--accent); background: var(--accent-soft); }
.prio-name { flex: 1; font-size: 16px; font-weight: 600; padding: 12px 0; }
.prio-btns { display: flex; gap: 8px; }
.prio-btn {
  width: 54px; height: 54px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800;
  border-radius: 12px;
  background: rgba(11, 16, 32, 0.8);
  border: 2px solid #4a5590;
  color: #b8c0e8;
  cursor: pointer; user-select: none;
  transition: all 0.15s;
}
.prio-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: transparent; color: #fff;
  transform: scale(1.05);
}
.prio-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.final-note {
  display: flex; align-items: center; gap: 14px;
  margin-top: 8px; padding: 18px 20px;
  background: rgba(47, 212, 129, 0.08);
  border: 1px solid rgba(47, 212, 129, 0.3);
  border-radius: 14px;
  color: var(--text);
}
.final-note svg { color: var(--ok); flex: none; }
.final-note p { font-size: 15px; color: var(--muted); }

/* ---------- Nav buttons ---------- */
.form-nav {
  display: flex; gap: 12px; justify-content: flex-end;
  margin-top: 10px; padding-top: 22px;
  border-top: 1px solid var(--stroke);
}
.btn {
  font: inherit; font-size: 17px; font-weight: 700;
  padding: 16px 30px; border-radius: 14px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  box-shadow: 0 6px 18px rgba(91, 140, 255, 0.28);
}
.btn.primary:hover { box-shadow: 0 10px 30px rgba(91, 140, 255, 0.5); }
.btn.ghost {
  background: transparent; border-color: #4a5590; color: #c7cdf0;
}
.btn.ghost:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.btn[hidden] { display: none; }
.btn:disabled { opacity: 0.6; cursor: default; }

/* ---------- Done ---------- */
.form-card.finished .form-nav { display: none; }
.form-card.finished { padding-bottom: 44px; }
.done-head { text-align: center; padding: 30px 0 10px; }
.done-head p { color: #c3caef; }
.done-icon { color: var(--ok); margin-bottom: 10px; }
.done-actions { display: flex; justify-content: center; padding-bottom: 20px; }

/* ---------- Footer / toast ---------- */
.footer { text-align: center; color: #7d85b3; font-size: 13px; padding: 26px 0 34px; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: #1c2450; color: var(--text);
  border: 1px solid var(--stroke);
  padding: 14px 24px; border-radius: 14px;
  font-size: 15px; font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none;
  transition: all 0.3s ease;
  max-width: min(90vw, 480px);
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: rgba(255, 91, 110, 0.6); }

/* ---------- Tablet / mobile ---------- */
@media (max-width: 720px) {
  .form-card { padding: 22px; }
  .opts-multi, .opts-single { grid-template-columns: 1fr; }
  .progress-wrap { min-width: 90px; }
  .progress-text { font-size: 12px; }
  .logo span { display: none; }
  .progress-bar { height: 10px; }
  .form-nav { gap: 10px; }
  .btn { padding: 16px 20px; }
  .btn.primary { flex: 1; }
  .btn.ghost { color: #c7cdf0; }
  .step-head p { font-size: 15px; }
  .muted, .step-head p { color: #aeb6dc; }
}

@media (min-width: 721px) and (max-width: 1024px) {
  .feature-items { grid-template-columns: 1fr 1fr; }
  .features .feature-items .opt span { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Admin ---------- */
body.admin-page { background: var(--bg); color: var(--text); }
.admin-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.admin-head h1 { font-size: 26px; }
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 720px) { .stats-grid { grid-template-columns: 1fr; } }
.stat-card {
  background: var(--card); border: 1px solid var(--stroke); border-radius: 14px;
  padding: 18px 20px;
}
.stat-card h3 { font-size: 15px; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.stat-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 15px; border-bottom: 1px dashed rgba(42,51,104,.5); }
.stat-row:last-child { border-bottom: none; }
.stat-row b { color: var(--accent); white-space: nowrap; }
.stat-row .bar { color: var(--muted); font-size: 13px; }
table.ans { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 18px; }
table.ans th { text-align: left; color: #b8c0e8; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 10px 12px; border-bottom: 1px solid var(--stroke); position: sticky; top: 0; background: var(--bg); }
table.ans td { padding: 10px 12px; border-bottom: 1px solid rgba(42,51,104,.4); vertical-align: top; }
table.ans tr:hover td { background: rgba(91,140,255,.05); }
.tag { display: inline-block; background: rgba(91, 140, 255, 0.18); color: #9fbaff; border: 1px solid rgba(91, 140, 255, 0.3); border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 600; margin: 2px 2px; }
.nowrap { white-space: nowrap; }
.admin-wrap { max-width: 1200px; margin: 0 auto; padding: 30px 20px 60px; }