/* ============================================================
   Biological Age Test · energetic health style
   ============================================================ */

:root {
  --ink: #17262e;
  --ink-soft: #5a6b72;
  --muted: #93a2a8;
  --orange: #ff6b35;
  --orange-deep: #f04e23;
  --green: #20c98b;
  --green-deep: #0fa974;
  --yellow: #ffc94a;
  --bg: #fff8f2;
  --card: #ffffff;
  --line: #f1e5da;
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --shadow-soft: 0 18px 44px -24px rgba(23, 38, 46, 0.35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

button,
input {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ---------- Background glow ---------- */

.bg-decor {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.6;
  animation: float 16s ease-in-out infinite alternate;
}

.orb--orange {
  width: 420px;
  height: 420px;
  top: -140px;
  right: -130px;
  background: radial-gradient(circle, #ffc2a2, #ffe8dc 70%);
}

.orb--green {
  width: 460px;
  height: 460px;
  bottom: -170px;
  left: -150px;
  background: radial-gradient(circle, #b7f5d9, #e9fbf3 70%);
  animation-delay: -6s;
}

.orb--yellow {
  width: 280px;
  height: 280px;
  top: 38%;
  left: -110px;
  background: radial-gradient(circle, #ffe7b0, #fff6e0 70%);
  animation-delay: -3s;
}

@keyframes float {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(0, -26px, 0) scale(1.07);
  }
}

/* ---------- Layout ---------- */

.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 26px 20px 44px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
  animation: viewIn 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.view--quiz.is-active {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 70px);
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Brand ---------- */

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.brand__mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, #ff8a5c, #f04e23);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 22px -10px rgba(240, 78, 35, 0.7);
}

.brand__name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* ---------- Welcome view ---------- */

.hero__tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 15px;
  border-radius: 999px;
  background: #ffe9de;
  color: var(--orange-deep);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.hero__title {
  margin-top: 20px;
  font-size: clamp(34px, 9vw, 54px);
  line-height: 1.14;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.hero__title em {
  font-style: normal;
  background: linear-gradient(92deg, #ff6b35, #f5a623 55%, #20c98b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero__desc {
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: 15px;
  max-width: 46ch;
}

.hero__points {
  margin-top: 26px;
  display: grid;
  gap: 12px;
}

.hero__points li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
}

.point-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e7faf2;
  color: var(--green-deep);
}

.point-icon svg {
  width: 13px;
  height: 13px;
}

#btn-start {
  margin-top: 30px;
}

.hero__note {
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.hero__stats {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 8px;
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-soft);
}

.hero__stats > div {
  text-align: center;
  position: relative;
}

.hero__stats > div + div::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 60%;
  background: var(--line);
}

.hero__stats strong {
  display: block;
  font-size: 26px;
  font-weight: 900;
  line-height: 1.1;
}

.hero__stats span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-weight: 800;
  border-radius: 999px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn[hidden] {
  display: none;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn--primary {
  background: linear-gradient(135deg, #ff7a45, #f04e23);
  color: #fff;
  padding: 16px 28px;
  font-size: 17px;
  box-shadow: 0 14px 30px -12px rgba(240, 78, 35, 0.65);
}

.btn--primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px -12px rgba(240, 78, 35, 0.72);
}

.btn--primary:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.btn--primary:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
}

.btn--ghost {
  background: #fff;
  color: var(--ink-soft);
  border: 1.5px solid var(--line);
  padding: 15px 24px;
  font-size: 15px;
}

.btn--ghost:hover {
  border-color: #e4d2c3;
  color: var(--ink);
}

.btn--lg {
  width: 100%;
  padding: 18px 34px;
  font-size: 18px;
}

.btn--block {
  width: 100%;
}

/* ---------- Quiz header ---------- */

.quiz-head {
  margin-bottom: 22px;
}

.quiz-head__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.quiz-head__label {
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.quiz-head__step {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: #f3e7dc;
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  width: 20%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff6b35, #ffc94a 55%, #20c98b);
  transition: width 0.45s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.step-dots {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.step-dot {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(23, 38, 46, 0.08);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.step-dot.is-done {
  background: linear-gradient(90deg, #ff6b35, #20c98b);
}

.step-dot.is-current {
  background: linear-gradient(90deg, #ff8a5c, #ff6b35);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.14);
}

/* ---------- Quiz content ---------- */

.quiz-body {
  flex: 1;
}

.quiz-section {
  margin-bottom: 16px;
}

.quiz-section__eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--orange);
  margin-bottom: 8px;
}

.quiz-section__title {
  font-size: clamp(26px, 6.5vw, 32px);
  font-weight: 900;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.quiz-section__subtitle {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 14px;
}

.q {
  background: var(--card);
  border: 1px solid #f5e9de;
  border-radius: var(--radius-lg);
  padding: 18px 18px 20px;
  margin-bottom: 14px;
  box-shadow: 0 10px 30px -22px rgba(23, 38, 46, 0.4);
  animation: cardIn 0.4s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.q__label {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.q__hint {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- Options ---------- */

.options {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 16px;
  background: #fffdfb;
  border: 1.5px solid #f1e5da;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease,
    box-shadow 0.18s ease, transform 0.18s ease;
}

.option:hover {
  border-color: #f3c7b0;
  transform: translateY(-1px);
}

.option.is-selected {
  border-color: var(--orange);
  background: #fff4ec;
  box-shadow: 0 10px 24px -16px rgba(255, 107, 53, 0.7);
}

.option.is-popping {
  animation: pop 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes pop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.018);
  }
  100% {
    transform: scale(1);
  }
}

.option__dot {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid #e3d3c5;
  background: #fff;
  position: relative;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.option__dot::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.18s ease;
}

.option.is-selected .option__dot {
  border-color: var(--orange);
  background: #fff;
}

.option.is-selected .option__dot::after {
  background: var(--orange);
}

.option__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.option__text strong {
  font-size: 15px;
  font-weight: 700;
}

.option__text small {
  font-size: 12.5px;
  color: var(--muted);
}

.options--row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.options--row .option {
  justify-content: center;
  padding: 13px 8px;
  text-align: center;
}

.options--row .option__dot {
  display: none;
}

/* ---------- Age slider ---------- */

.age-slider {
  margin-top: 16px;
  padding: 16px 16px 12px;
  border-radius: var(--radius-md);
  background: linear-gradient(150deg, #fff9f4, #fff4ec);
  border: 1px dashed #f3d9c8;
}

.age-slider__value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin-bottom: 14px;
}

.age-slider__num {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--orange-deep);
}

.age-slider__value small {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}

.age-slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  outline: none;
  background: linear-gradient(
    90deg,
    #ff8a5c 0%,
    #ff6b35 calc(var(--p, 20) * 1%),
    #f1e2d7 calc(var(--p, 20) * 1%),
    #f1e2d7 100%
  );
}

.age-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  border: 7px solid var(--orange);
  box-shadow: 0 6px 16px rgba(255, 107, 53, 0.35);
  cursor: grab;
}

.age-slider input[type="range"]::-webkit-slider-thumb:active {
  cursor: grabbing;
}

.age-slider input[type="range"]::-moz-range-thumb {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  border: 7px solid var(--orange);
  box-shadow: 0 6px 16px rgba(255, 107, 53, 0.35);
  cursor: grab;
}

.age-slider__scale {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

/* ---------- Height & weight ---------- */

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.field {
  display: block;
}

.field__label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}

.field__control {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 11px 14px;
  background: #fffdfb;
  border: 1.5px solid #f1e5da;
  border-radius: 16px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field__control:focus-within {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.12);
}

.field__control input {
  width: 100%;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.field__control input::-webkit-outer-spin-button,
.field__control input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.field__control input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.field__control em {
  font-style: normal;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}

.field-hint {
  margin-top: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.field-hint.is-valid {
  color: var(--green-deep);
}

/* ---------- Quiz footer ---------- */

.quiz-foot {
  display: flex;
  gap: 12px;
  padding-top: 18px;
}

.quiz-foot .btn--ghost {
  flex: 0 0 auto;
}

.quiz-foot .btn--primary {
  flex: 1;
  padding: 16px 20px;
}

/* ---------- Result view ---------- */

.view--result {
  --band: #1fbf85;
  --band-soft: #e7faf2;
}

.view--result[data-band="great"] {
  --band: #0fa974;
  --band-soft: #e3f8ee;
}

.view--result[data-band="good"] {
  --band: #1fbf85;
  --band-soft: #e7faf2;
}

.view--result[data-band="watch"] {
  --band: #e89a1c;
  --band-soft: #fff4de;
}

.view--result[data-band="risk"] {
  --band: #ef4e23;
  --band-soft: #ffe9e0;
}

.result-head {
  text-align: center;
  padding: 8px 8px 6px;
}

.result-head__eyebrow {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.result-age {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.result-age__value {
  font-size: clamp(84px, 24vw, 128px);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.result-age__unit {
  font-size: 24px;
  font-weight: 800;
  color: var(--muted);
}

.result-delta {
  display: inline-block;
  margin-top: 14px;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--band-soft);
  color: var(--band);
  font-size: 16px;
  font-weight: 800;
}

.result-band {
  margin-top: 16px;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.result-desc {
  margin-top: 6px;
  font-size: 14px;
  color: var(--ink-soft);
  max-width: 34ch;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Result cards ---------- */

.card {
  margin-top: 16px;
  padding: 20px 20px 22px;
  background: var(--card);
  border: 1px solid #f5e9de;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.card__title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 14px;
}

.compare-row {
  display: grid;
  grid-template-columns: 68px 1fr 58px;
  align-items: center;
  gap: 12px;
}

.compare-row + .compare-row {
  margin-top: 12px;
}

.compare-row__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}

.compare-row__track {
  height: 12px;
  border-radius: 999px;
  background: #f6ece3;
  overflow: hidden;
}

.compare-row__fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  transition: width 0.9s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.compare-row__fill--real {
  background: #d9c6b7;
}

.compare-row__fill--bio {
  background: linear-gradient(90deg, #ff8a5c, var(--band));
}

.compare-row__value {
  text-align: right;
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.compare-note {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

/* ---------- Dimensions ---------- */

.dimension + .dimension {
  margin-top: 16px;
}

.dimension__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 7px;
}

.dimension__label {
  font-size: 14px;
  font-weight: 700;
}

.dimension__score {
  font-size: 13px;
  font-weight: 800;
  color: var(--band);
  font-variant-numeric: tabular-nums;
}

.dimension__track {
  height: 10px;
  border-radius: 999px;
  background: #f6ece3;
  overflow: hidden;
}

.dimension__fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff8a5c, #20c98b);
  transition: width 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) 0.1s;
}

/* ---------- Share ---------- */

.share-preview {
  margin-bottom: 16px;
}

.share-preview canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 16px 40px -24px rgba(23, 38, 46, 0.5);
}

.result-actions {
  margin-top: 18px;
}

.result-actions .btn {
  width: 100%;
}

.result-actions .btn + .btn {
  margin-top: 10px;
}

.result-disclaimer {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}

/* ---------- Result card modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 38, 46, 0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.modal__dialog {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 30px 24px 24px;
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: 0 30px 70px -30px rgba(23, 38, 46, 0.6);
  text-align: center;
  animation: modal-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #f7efe7;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.modal__close:hover {
  background: #f1e2d5;
  transform: scale(1.05);
}

.modal__close svg {
  width: 16px;
  height: 16px;
}

.modal__icon {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  margin: 4px auto 16px;
  border-radius: 22px;
  background: linear-gradient(135deg, #fff1e7, #e6f9f1);
  color: var(--orange-deep);
}

.modal__icon svg {
  width: 34px;
  height: 34px;
}

.modal__icon svg[hidden] {
  display: none;
}

#modal-icon-check {
  color: var(--green-deep);
}

.modal__title {
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.modal__desc {
  margin-top: 9px;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.65;
}

.modal__tip {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8f3ed;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  text-align: start;
}

.modal__tip[hidden] {
  display: none;
}

.modal__form {
  margin-top: 18px;
  text-align: start;
}

.modal__form[hidden] {
  display: none;
}

.modal__input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fffdfb;
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
}

.modal__input::placeholder {
  color: var(--muted);
  font-weight: 500;
}

.modal__input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.14);
}

.modal__input.is-invalid {
  border-color: #e0442a;
  box-shadow: 0 0 0 4px rgba(224, 68, 42, 0.12);
}

.modal__error {
  margin: 8px 2px 0;
  font-size: 12.5px;
  font-weight: 700;
  color: #e0442a;
  line-height: 1.5;
}

.modal__error:empty {
  display: none;
}

.modal__form .btn {
  margin-top: 14px;
}

.modal__actions {
  margin-top: 20px;
}

.modal__actions .btn + .btn {
  margin-top: 10px;
}

.modal__actions[hidden] {
  display: none;
}

body.modal-open {
  overflow: hidden;
}

/* ---------- Language switcher ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.lang-switch {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 30;
}

.lang-switch select {
  -webkit-appearance: none;
  appearance: none;
  padding: 9px 34px 9px 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.94);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%235A6B72' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-soft);
  cursor: pointer;
  box-shadow: 0 8px 20px -14px rgba(23, 38, 46, 0.5);
  backdrop-filter: blur(6px);
}

.lang-switch select:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

/* ---------- RTL ---------- */

[dir="rtl"] .lang-switch {
  right: auto;
  left: 16px;
}

[dir="rtl"] .lang-switch select {
  padding: 9px 14px 9px 34px;
  background-position: left 12px center;
}

[dir="rtl"] .option {
  text-align: right;
}

[dir="rtl"] .options--row .option {
  text-align: center;
}

[dir="rtl"] .hero__points li {
  text-align: right;
}

[dir="rtl"] .compare-row__value {
  text-align: left;
}

[dir="rtl"] .compare-row__fill--bio {
  background: linear-gradient(270deg, #ff8a5c, var(--band));
}

[dir="rtl"] .age-slider input[type="range"] {
  direction: ltr;
}

[dir="rtl"] .modal__close {
  right: auto;
  left: 14px;
}

[dir="rtl"] .modal__form {
  text-align: right;
}

[dir="rtl"] .modal__tip {
  text-align: right;
}

[dir="rtl"] .age-slider__scale {
  direction: ltr;
}

html[lang="ar"] body {
  font-family: "Segoe UI", Tahoma, "Geeza Pro", "Noto Naskh Arabic", "Microsoft YaHei", sans-serif;
}

/* ---------- Responsive ---------- */

@media (max-width: 400px) {
  .app {
    padding: 20px 16px 36px;
  }

  .modal {
    padding: 14px;
  }

  .modal__dialog {
    padding: 26px 18px 20px;
  }

  .modal__title {
    font-size: 19px;
  }

  .q {
    padding: 16px 14px 18px;
  }

  .option {
    padding: 12px 13px;
  }

  .compare-row {
    grid-template-columns: 60px 1fr 52px;
    gap: 9px;
  }

  .compare-row__value {
    font-size: 13px;
  }

  .result-age__value {
    font-size: 88px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
