:root {
  --bg: #f7f5ef;
  --card: #ffffff;
  --ink: #17212b;
  --muted: #4a5663;
  --line: #9aa5b1;
  --brand: #0b5a5e;
  --brand-dark: #07454a;
  --brand-soft: #e1f0ef;
  --danger: #a12a1c;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "Segoe UI", "Noto Sans Arabic", "Geeza Pro", Tahoma, Arial, sans-serif;
  font-size: 22px;
  line-height: 1.6;
}

button, textarea, input { font: inherit; color: inherit; }

/* ---------- top bar ---------- */
.top {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 20px 0;
}
.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
}
.progress-label {
  margin: 0;
  font-weight: 700;
  color: var(--brand-dark);
}
.lang-btn {
  margin-inline-start: auto;
  min-height: 52px;
  padding: 8px 20px;
  background: var(--card);
  border: 2px solid var(--brand);
  border-radius: 8px;
  color: var(--brand-dark);
  font-weight: 700;
  cursor: pointer;
}
.progress-track {
  height: 14px;
  margin-top: 12px;
  background: #d5dbe0;
  border-radius: 7px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--brand);
  border-radius: 7px;
  transition: width 0.25s ease;
}

/* ---------- screen ---------- */
.screen {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px 40px;
}
.question {
  margin: 0 0 12px;
  font-size: 30px;
  line-height: 1.4;
  font-weight: 700;
}
.question:focus { outline: none; }
.hint {
  margin: 0 0 20px;
  color: var(--muted);
  font-weight: 600;
}
.options {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}
.option {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 76px;
  padding: 16px 20px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 10px;
  text-align: start;
  font-size: 23px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
}
.option .mark {
  flex: none;
  width: 34px;
  height: 34px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 22px;
  line-height: 1;
}
.option[role="checkbox"] .mark { border-radius: 6px; }
.option[aria-checked="true"] {
  border-color: var(--brand);
  border-width: 4px;
  padding: 14px 18px;
  background: var(--brand-soft);
}
.option[aria-checked="true"] .mark {
  background: var(--brand);
  border-color: var(--brand);
}

/* 1 to 5 scale */
.scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 28px;
}
.scale .option {
  justify-content: center;
  min-height: 84px;
  padding: 8px;
  font-size: 34px;
  font-weight: 700;
}
.scale .option[aria-checked="true"] {
  padding: 6px;
  background: var(--brand);
  color: #fff;
}
.scale-ends {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  color: var(--muted);
  font-weight: 600;
  font-size: 20px;
}

textarea {
  display: block;
  width: 100%;
  min-height: 190px;
  margin-top: 24px;
  padding: 16px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 10px;
  font-size: 23px;
  line-height: 1.6;
  resize: vertical;
}

.error {
  margin: 24px 0 0;
  padding: 16px 20px;
  background: #fbe9e6;
  border: 2px solid var(--danger);
  border-radius: 10px;
  color: var(--danger);
  font-weight: 700;
}

/* ---------- welcome and thank you ---------- */
.center { text-align: center; padding-top: 6vh; }
.center h1 {
  margin: 0 0 20px;
  font-size: 34px;
  line-height: 1.35;
}
.center p { margin: 0 0 14px; font-size: 23px; }
.center .btn { margin-top: 28px; width: 100%; max-width: 360px; min-height: 80px; font-size: 28px; }
.big-check {
  width: 96px;
  height: 96px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 56px;
  line-height: 96px;
}

/* ---------- buttons ---------- */
.btn {
  min-height: 68px;
  padding: 12px 24px;
  border: 2px solid var(--brand);
  border-radius: 10px;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-secondary { background: var(--card); color: var(--brand-dark); }
.btn:disabled {
  background: #d5dbe0;
  border-color: #d5dbe0;
  color: #5c6773;
  cursor: not-allowed;
}

.nav {
  position: sticky;
  bottom: 0;
  width: 100%;
  background: var(--bg);
  border-top: 2px solid #d5dbe0;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
}
.nav:not([hidden]) {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 14px;
}
@media (min-width: 760px) {
  .nav:not([hidden]) {
    max-width: 720px;
    margin: 0 auto;
    border-top: 0;
  }
}

button:focus-visible, textarea:focus-visible {
  outline: 4px solid #e39a12;
  outline-offset: 3px;
}

@media (max-width: 380px) {
  .question { font-size: 28px; }
  .scale { gap: 6px; }
}
