@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@500;600;700;800&family=Heebo:wght@400;500;600&display=swap');

:root {
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-navy: #1a1d3b;
  --color-navy-light: #3d4166;
  --color-gray: #8a94a6;
  --color-border: rgba(0,0,0,0.07);
  --color-purple: #6d28d9;
  --color-pink: #e91e8c;
  --gradient-brand: linear-gradient(135deg, #6d28d9, #e91e8c);
  --gradient-brand-text: linear-gradient(90deg, #5b21b6 0%, #e91e8c 100%);
  --blob-lavender: rgba(139, 92, 246, 0.14);
  --blob-pink: rgba(233, 30, 140, 0.09);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 4px 20px rgba(0,0,0,0.05);
  --tile-bg: #ffffff;
  --tile-bg-selected: rgba(109,40,217,0.07);
  --tile-border-selected: #6d28d9;
  --input-bg: #ffffff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-navy);
  font-family: 'Heebo', sans-serif;
  direction: rtl;
}

body {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  padding: 40px 16px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  align-items: safe center;
  justify-content: safe center;
}

@media (max-width: 480px) {
  body { padding: 24px 12px 40px; }
}

body::before {
  content: '';
  position: fixed;
  top: -120px; left: -120px;
  width: 460px; height: 460px;
  background: radial-gradient(circle, var(--blob-lavender), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  bottom: -100px; left: -60px;
  width: 380px; height: 380px;
  background: radial-gradient(circle, var(--blob-pink), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

#app, .page-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}

.eyebrow {
  font-family: 'Rubik', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--color-purple);
  text-align: center;
  margin-bottom: 10px;
}

.progress-wrap { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.progress-track { flex: 1; height: 6px; border-radius: 4px; background: var(--color-border); overflow: hidden; }
.progress-fill { height: 100%; background: var(--gradient-brand); border-radius: 4px; transition: width 0.35s ease; }
.progress-label { font-size: 12px; color: var(--color-gray); white-space: nowrap; font-variant-numeric: tabular-nums; }

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  padding: 32px 28px;
  animation: rise 0.35s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .card { animation: none; } }

@media (max-width: 480px) {
  .card { padding: 22px 16px; border-radius: 14px; }
}

h1.hero-title {
  font-family: 'Rubik', sans-serif;
  font-weight: 800;
  font-size: 32px;
  line-height: 1.3;
  text-align: center;
  color: var(--color-navy);
  margin: 0 0 16px;
}
h1.hero-title::after {
  content: '';
  display: block;
  width: 64px;
  height: 3px;
  background: var(--gradient-brand);
  border-radius: 2px;
  margin: 12px auto 0;
}

@media (max-width: 480px) {
  h1.hero-title { font-size: 25px; }
}

.section-title {
  font-family: 'Rubik', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--color-navy);
  margin: 0 0 14px;
}
.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--gradient-brand);
  border-radius: 2px;
  margin-top: 10px;
}

.question-block { margin-bottom: 28px; }
.question-block:last-child { margin-bottom: 0; }

.q-title { font-family: 'Rubik', sans-serif; font-weight: 700; font-size: 17.5px; color: var(--color-navy); margin: 0 0 6px; }
.q-hint { font-size: 13px; color: var(--color-gray); margin: 0 0 14px; line-height: 1.6; }

.intro-body { font-size: 15.5px; line-height: 1.75; color: var(--color-navy-light); text-align: center; max-width: 480px; margin: 0 auto 26px; }

label.field-label { display: block; font-size: 14px; font-weight: 500; color: var(--color-navy); margin-bottom: 6px; }
.field-hint { font-size: 12.5px; color: var(--color-gray); margin: 4px 2px 0; line-height: 1.5; }

input[type="text"], input[type="email"], input[type="password"], textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: 'Heebo', sans-serif;
  font-size: 14.5px;
  color: var(--color-navy);
  transition: border-color 0.15s ease;
}
input:focus, textarea:focus { outline: none; border-color: var(--color-purple); }
textarea { min-height: 90px; resize: vertical; line-height: 1.6; }

.tool-row { margin-bottom: 16px; }
.tool-row:last-child { margin-bottom: 0; }

fieldset { border: none; margin: 0; padding: 0; }

.chip-grid { display: flex; flex-direction: column; gap: 10px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip label {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px;
  border: 1px solid var(--color-border); border-radius: 12px;
  background: var(--tile-bg); font-size: 14.5px; color: var(--color-navy-light);
  cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.chip-box {
  flex: none; width: 20px; height: 20px; border-radius: 6px;
  border: 1.5px solid var(--color-border); background: var(--input-bg);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.chip-box::after {
  content: '';
  width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
  opacity: 0;
}
.chip input:checked + label .chip-box { background: var(--gradient-brand); border-color: transparent; }
.chip input:checked + label .chip-box::after { opacity: 1; }
.chip input:checked + label { border-color: var(--tile-border-selected); background: var(--tile-bg-selected); color: var(--color-navy); font-weight: 500; }
.chip input:focus-visible + label { outline: 2px solid var(--color-purple); outline-offset: 2px; }
.chip input:disabled + label { opacity: 0.4; cursor: not-allowed; }

.rating-row { padding: 14px 0; border-bottom: 1px solid var(--color-border); }
.rating-row:last-child { border-bottom: none; }
.rating-name { display: block; font-size: 14.5px; font-weight: 600; color: var(--color-navy); margin-bottom: 10px; }
.rating-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pill label {
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 9px 6px; min-height: 38px;
  border: 1px solid rgba(109,40,217,0.16); border-radius: 10px;
  background: rgba(109,40,217,0.04); font-size: 11.5px; line-height: 1.3; color: var(--color-navy-light);
  cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.pill input:checked + label { border-color: transparent; background: var(--gradient-brand); color: #fff; font-weight: 600; }
.pill input:focus-visible + label { outline: 2px solid var(--color-purple); outline-offset: 2px; }

@media (max-width: 480px) {
  .rating-options { grid-template-columns: repeat(2, 1fr); }
}

.nav-row { display: flex; gap: 12px; margin-top: 28px; }
button.btn {
  font-family: 'Heebo', sans-serif; font-size: 14.5px; font-weight: 600;
  padding: 13px 22px; border-radius: 11px; border: none; cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}
button.btn:active { transform: translateY(1px); }
button.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { flex: 1; background: var(--gradient-brand); color: #fff; box-shadow: 0 3px 14px rgba(109,40,217,0.28); }
.btn-primary:hover { box-shadow: 0 5px 18px rgba(109,40,217,0.36); }
.btn-ghost { background: transparent; color: var(--color-gray); border: 1px solid var(--color-border); }
.btn-ghost:hover { color: var(--color-navy); }

.dot-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 28px; }
.step-dots { display: flex; gap: 8px; }
.step-dot {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--color-border); background: var(--tile-bg);
  color: var(--color-gray); font-family: 'Heebo', sans-serif; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.15s ease;
}
.step-dot:hover { border-color: var(--color-purple); color: var(--color-purple); }
.step-dot.active { background: var(--gradient-brand); border-color: transparent; color: #fff; }
.arrow-btn {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  border: 1px solid var(--color-border); background: var(--tile-bg);
  color: var(--color-navy); font-size: 18px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.arrow-btn:hover { border-color: var(--color-purple); box-shadow: 0 2px 10px rgba(109,40,217,0.18); }
.arrow-btn:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; }
.btn-wide { width: 100%; }

.done-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--gradient-brand); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 24px; margin: 0 auto 16px; }
.error-text { color: var(--color-pink); font-size: 13.5px; text-align: center; margin-top: 12px; }
.limit-note { color: var(--color-pink); font-size: 12.5px; margin-top: 8px; }

/* Admin */
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow-card); }
.stat-number { font-family: 'Rubik', sans-serif; font-size: 28px; font-weight: 800; color: var(--color-navy); }
.stat-label { font-size: 12.5px; color: var(--color-gray); margin-top: 4px; }
.search-box { margin-bottom: 16px; }
.participant-row {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px;
  padding: 14px 18px; margin-bottom: 10px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  transition: box-shadow 0.15s ease;
}
.participant-row:hover { box-shadow: var(--shadow-card); }
.participant-name { font-weight: 600; font-size: 15px; }
.participant-meta { font-size: 12.5px; color: var(--color-gray); }
.empty-state { text-align: center; color: var(--color-gray); padding: 40px 16px; font-size: 14px; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(20,22,42,0.5); z-index: 20; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.modal-card { background: var(--color-surface); border-radius: 18px; max-width: 640px; width: 100%; padding: 28px; box-shadow: var(--shadow-card); }
.modal-close { float: left; background: none; border: none; color: var(--color-gray); font-size: 20px; cursor: pointer; }
.detail-field { margin-bottom: 16px; }
.detail-label { font-size: 12px; color: var(--color-gray); text-transform: none; margin-bottom: 4px; }
.detail-value { font-size: 14.5px; color: var(--color-navy); white-space: pre-wrap; line-height: 1.6; }
.summary-tags-list { font-size: 13px; color: var(--color-navy-light); line-height: 1.9; }
