/* DALLANI STORE ALIGNMENT POLISH | warm beige + softer shadows */
:root {
  --ink: #3e352f;
  --muted: #7a6b5a;
  --paper: #fbf6ef;
  --canvas: #f5efe7;
  --line: #e7ddd3;
  --rose: #c98a71;
  --rose-soft: #f8eae4;
  --brown: #8a6a52;
  --shadow: 0 14px 36px rgba(62, 53, 47, .07);
  --radius-card: 22px;
  --radius-control: 15px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  font-family: "Tajawal", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
button { font: inherit; }

.progress {
  position: fixed;
  inset: 0 0 auto;
  height: 4px;
  background: #eadfd9;
  z-index: 20;
}
.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--brown);
  transition: width .45s ease;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}
.advisor-card {
  width: min(100%, 430px);
  min-height: min(760px, calc(100vh - 36px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid rgba(75, 70, 61, .08);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.topbar {
  min-height: 70px;
  padding: 12px 18px;
  display: grid;
  grid-template-columns: 42px 1fr 82px;
  align-items: center;
}
.topbar-meta {
  display: grid;
  justify-items: end;
  gap: 4px;
}
.language-button {
  min-width: 39px;
  min-height: 27px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brown);
  background: #fff;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.language-button:active { transform: scale(.96); }
.brand-mark {
  grid-column: 2;
  width: 46px;
  height: 46px;
  margin: auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 5px 14px rgba(62, 53, 47, .06);
}
.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--brown);
  background: #fff;
  cursor: pointer;
  transition: transform .2s ease;
}
.icon-button:active { transform: scale(.92); }
.icon-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.is-hidden { visibility: hidden; pointer-events: none; }
.step-label { text-align: start; color: #9b887d; font-size: 12px; font-weight: 700; }

#app { flex: 1; padding: 0 20px 22px; }
.screen { animation: screen-in .38s ease both; }
@keyframes screen-in {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}

h1, h2, h3 { margin: 0; color: var(--brown); line-height: 1.5; }
h1 { font-size: 24px; }
.eyebrow { margin: 0; color: var(--rose); font-size: 12.5px; font-weight: 800; }
.lead { margin: 8px 0 14px; color: var(--muted); font-size: 14.5px; line-height: 1.75; }
.helper { margin: 0; color: #947f73; font-size: 13px; line-height: 1.6; }

.media-card {
  position: relative;
  overflow: hidden;
  background: #efe6dc;
  border: 1px solid rgba(229, 211, 201, .9);
  border-radius: var(--radius-card);
  isolation: isolate;
}
.media-welcome {
  width: min(100%, 42vh, 390px);
  aspect-ratio: 1;
  margin-inline: auto;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(62, 53, 47, .08);
}
.media-response {
  width: min(100%, 230px);
  aspect-ratio: 1;
  margin-inline: auto;
  border-radius: 20px;
}
.media-result { width: min(100%, 230px); aspect-ratio: 1; margin-inline: auto; border-radius: 20px; }
.advisor-video, .advisor-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.advisor-video { background: #efe6dc; }
.sound-pill {
  position: absolute;
  top: 11px;
  left: 11px;
  z-index: 3;
  padding: 6px 10px;
  border-radius: 999px;
  color: #fff;
  background: rgba(45, 31, 24, .72);
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(7px);
}
.media-start-button {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 4;
  width: 54px;
  height: 54px;
  padding: 0 4px 0 0;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 50%;
  color: #fff;
  background: rgba(89, 63, 49, .72);
  box-shadow: 0 8px 22px rgba(44, 31, 24, .22);
  cursor: pointer;
}
.replay-button {
  position: absolute;
  right: 11px;
  bottom: 11px;
  z-index: 4;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .68);
  border-radius: 999px;
  color: #fff;
  background: rgba(45, 31, 24, .74);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.replay-button[hidden], .media-start-button[hidden] { display: none; }

.welcome-copy { padding-top: 15px; text-align: center; }
.primary {
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  border: 0;
  border-radius: var(--radius-control);
  color: #fff;
  background: var(--brown);
  box-shadow: 0 8px 20px rgba(128, 96, 71, .2);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .2s ease, opacity .2s ease, box-shadow .2s ease;
}
.primary:active { transform: scale(.98); }
.primary:disabled { opacity: .74; cursor: default; box-shadow: none; }
.text-action {
  margin-top: 10px;
  padding: 7px 10px;
  border: 0;
  color: #8f796d;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.attention { animation: button-pulse .8s ease 1; }
@keyframes button-pulse {
  50% { transform: scale(1.018); box-shadow: 0 0 0 7px rgba(166, 124, 99, .12); }
}

.question-header { margin: 2px 0 14px; }
.question-title { margin: 6px 0 5px; font-size: 21px; }
.answers { display: grid; gap: 10px; }
.answer {
  width: 100%;
  min-height: 58px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr 23px;
  gap: 11px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: #fff;
  text-align: start;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
  animation: answer-in .32s ease both;
}
.answer:nth-child(2) { animation-delay: .04s; }
.answer:nth-child(3) { animation-delay: .08s; }
.answer:nth-child(4) { animation-delay: .12s; }
@keyframes answer-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}
.answer:hover { border-color: #d7ad9c; background: #fdf9f4; }
.answer-text { font-size: 14.5px; line-height: 1.55; font-weight: 600; }
.answer-check {
  width: 21px;
  height: 21px;
  justify-self: left;
  border: 1.5px solid #ddc9bf;
  border-radius: 50%;
}

.response-card, .confirmation-card {
  overflow: hidden;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: #fff;
  box-shadow: 0 8px 22px rgba(62, 53, 47, .05);
  animation: response-in .36s ease both;
}
@keyframes response-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.selection-summary {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 9px;
  align-items: center;
  padding: 2px 2px 11px;
}
.selection-check {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--rose);
  font-size: 12px;
  font-weight: 800;
}
.selection-copy { min-width: 0; }
.selection-copy span { display: block; color: #a18d82; font-size: 11.5px; font-weight: 700; }
.selection-copy strong { display: block; color: var(--ink); font-size: 13.5px; line-height: 1.45; }
.change-answer-btn {
  padding: 5px 2px;
  border: 0;
  color: var(--rose);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.advisor-reply {
  position: relative;
  margin: 0;
  padding-block: 12px;
  padding-inline: 29px 13px;
  color: #66544a;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.7;
  text-align: start;
}
.advisor-reply::before {
  content: "";
  position: absolute;
  top: 20px;
  inset-inline-start: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rose);
}
.response-next { margin-top: 1px; }
.confirmation-copy {
  margin: 3px 2px 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  text-align: center;
}

.analysis { padding-top: 20px; text-align: center; }
.thinking-ring {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  margin: 0 auto 15px;
  border: 3px solid var(--rose-soft);
  border-top-color: var(--rose);
  border-radius: 50%;
  color: transparent;
  animation: spin 1s linear infinite;
}
.thinking-ring.stopped {
  border-color: var(--rose);
  color: var(--brown);
  background: var(--rose-soft);
  animation: none;
}
.thinking-ring.stopped::after { content: "✓"; font-size: 27px; font-weight: 800; }
@keyframes spin { to { transform: rotate(1turn); } }
.analysis-list { display: grid; gap: 8px; margin: 16px 0; }
.analysis-row {
  padding: 11px 13px;
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  font-size: 13.5px;
  font-weight: 600;
  text-align: start;
  opacity: 0;
  transform: translateY(7px);
  transition: opacity .35s ease, transform .35s ease;
}
.analysis-row.show { opacity: 1; transform: none; }
.analysis-row span {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--rose);
  font-size: 11px;
}

.result { padding-bottom: 2px; }
.result-hero {
  padding: 15px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(62, 53, 47, .06);
}
.result-head { margin-bottom: 11px; text-align: center; }
.result-row-flex {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 3px;
}
.result-letter {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--result-color);
  font-size: 18px;
  font-weight: 800;
}
.result-head h2 { font-size: 20px; }
.result-summary { margin-top: 12px; }
.result-reason {
  margin: 0;
  color: #5f5048;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.72;
  text-align: start;
}
.result-usage {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid #efe3dc;
  color: var(--brown);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.65;
  text-align: start;
}
.shop-action-box { margin-top: 13px; }
.shop-button {
  color: var(--result-color);
  background: var(--result-soft);
  border: 1.5px solid var(--result-color);
  box-shadow: 0 8px 20px rgba(62, 53, 47, .10);
}
.shop-button:hover {
  filter: saturate(1.06);
}
.shop-button:active {
  transform: scale(.98);
}
.shop-note {
  display: block;
  margin-top: 6px;
  color: #917e73;
  font-size: 11.5px;
  line-height: 1.5;
  text-align: center;
}
.support-card {
  margin-top: 12px;
  padding: 13px 14px 4px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: #fff;
}
.support-card h3 { margin-bottom: 5px; font-size: 14.5px; }
.support-card ul { margin: 0; padding: 0; list-style: none; }
.support-card li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid #f0e6e0;
  color: #66564d;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}
.support-card li:last-child { border-bottom: 0; }
.support-card li span {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--result-color);
  background: var(--result-soft);
  font-size: 10px;
  font-weight: 800;
}
.share-card {
  margin-top: 12px;
  padding: 14px 13px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: #faf5ef;
  text-align: center;
}
.share-kicker { display: block; margin-bottom: 4px; color: var(--brown); font-size: 14.5px; font-weight: 800; }
.share-card p { margin: 0 0 10px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.whatsapp-button {
  width: 100%;
  min-height: 45px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1.5px solid #25a85a;
  border-radius: 13px;
  color: #168a47;
  background: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.whatsapp-button:active { transform: scale(.98); }
.whatsapp-button svg { width: 19px; height: 19px; fill: currentColor; }
.restart-link {
  width: auto;
  display: block;
  margin: 13px auto 3px;
  padding: 5px;
  border: 0;
  color: #927f74;
  background: transparent;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

footer { padding: 10px 18px 14px; border-top: 1px solid #ece2da; text-align: center; }
footer a { color: #9b887d; font-size: 11px; text-decoration: none; }

html[dir="ltr"] body { font-family: "Manrope", "Tajawal", sans-serif; }
html[dir="ltr"] .topbar-meta { justify-items: end; }
html[dir="ltr"] .answer-check { justify-self: right; }
html[dir="ltr"] .support-card h3 { text-align: left; }

@media (max-width: 470px) {
  .page-shell { padding: 0; }
  .advisor-card { min-height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
  .topbar { min-height: 62px; padding-block: 9px; }
  #app { padding-inline: 14px; }
  .media-welcome { width: min(100%, 42vh); }
  .question-title { font-size: 20px; }
}

@media (max-height: 700px) and (max-width: 470px) {
  .topbar { min-height: 56px; }
  .brand-mark { width: 41px; height: 41px; }
  .media-welcome { width: min(100%, 38vh); }
  .welcome-copy { padding-top: 11px; }
  .lead { margin-bottom: 10px; line-height: 1.6; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
