:root {
  --from: #FFB23F;
  --to: #F2581E;
  --ink: #FFFFFF;
  --face: #1E1A17;
  --radius: 999px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; scrollbar-width: none; }
body::-webkit-scrollbar { display: none; }
body {
  font-family: Urbanist, Arial, 'Helvetica Neue', -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: linear-gradient(165deg, var(--from) 0%, var(--to) 100%) fixed;
  background-color: var(--to);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* Soft floating blobs, like the reference shot */
.bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.blob { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .22; background: var(--ink); }
.b1 { width: 260px; height: 260px; top: -90px; right: -80px; animation: float 14s ease-in-out infinite; }
.b2 { width: 140px; height: 140px; bottom: 18%; left: -60px; animation: float 11s ease-in-out infinite reverse; opacity: .14; }
.b3 { width: 70px; height: 70px; top: 38%; right: 8%; animation: float 9s ease-in-out infinite; opacity: .12; }
@keyframes float { 50% { transform: translate(10px, 18px) scale(1.05); } }

.screen {
  position: relative; z-index: 1;
  min-height: 100dvh;
  max-width: 460px; margin: 0 auto;
  padding: 20px 24px calc(24px + var(--safe-b));
  display: flex; flex-direction: column;
  animation: in .5s cubic-bezier(.2,.8,.2,1);
}
@keyframes in { from { opacity: 0; transform: translateY(12px); } }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo {
  width: 56px; height: 56px; border-radius: 15px; flex: none;
  background: color-mix(in srgb, var(--ink) 22%, transparent);
  display: grid; place-items: center; overflow: hidden;
  font-weight: 800; font-size: 19px; letter-spacing: .5px;
}
.logo img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.biz-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .95; }
.skip {
  background: none; border: 0; padding: 8px 4px; cursor: pointer;
  font-size: 12px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase;
  text-decoration: underline; text-underline-offset: 4px; opacity: .9;
}

.intro { margin-top: 26px; }
/* Bold headline at the original large size; wraps onto balanced lines when needed. */
.headline { margin: 0 0 22px; text-align: center; font-size: clamp(28px, 8vw, 34px); line-height: 1.12; font-weight: 800; letter-spacing: -.5px; text-wrap: balance; }

.face-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 18px 0 6px; min-height: 210px; }
.face { width: min(240px, 62vw); height: auto; overflow: visible; }
.face { transform-origin: 50% 60%; }
.face .eye { fill: var(--face); transform-box: fill-box; transform-origin: center; animation: blink 4s infinite; }
.face .mouth, .face .brows path { fill: none; stroke: var(--face); stroke-width: 11; stroke-linecap: round; stroke-linejoin: round; }
.face .brows path { stroke-width: 8; transition: opacity .3s; }
.face .cheek { fill: #FF5C7A; opacity: 0; transition: opacity .35s; }
@keyframes blink { 0%, 46%, 50%, 100% { transform: scaleY(1); } 48% { transform: scaleY(.1); } }
.mood { margin: 14px 0 0; font-size: 18px; font-weight: 700; min-height: 1.4em; transition: transform .25s; }
.mood.pop { transform: scale(1.08); }

/* Stars always fill left to right, in English and Arabic */
.rating { display: flex; justify-content: center; gap: 4px; margin: 4px 0 18px; direction: ltr; }
/* Mini stars (buttons keep the .dot class for the existing logic) */
.dot {
  --i: 0;
  position: relative; width: 50px; height: 50px; border: 0; padding: 0; background: none; cursor: pointer;
  display: grid; place-items: center; border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
.dot svg { width: 30px; height: 30px; overflow: visible; transition: transform .3s cubic-bezier(.3,1.6,.5,1), filter .3s; }
.dot .star {
  fill: transparent; stroke: color-mix(in srgb, var(--ink) 70%, transparent); stroke-width: 1.7; stroke-linejoin: round;
  transition: fill .22s ease, stroke .22s ease;
}
.dot.on .star { fill: var(--ink); stroke: var(--ink); }
.dot.on svg { transform: scale(1.12); filter: drop-shadow(0 4px 10px rgba(0,0,0,.18)); }
.dot:hover:not(.on) svg { transform: scale(1.12) rotate(-8deg); }
.dot:active svg { transform: scale(.88); }
.dot:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Waiting for a rating: every star gets the same bright outline, big pop with glow and sparkle,
   in a wave from star 1 to star 5 */
.rating:not(.rated) .dot .star { stroke: var(--ink); stroke-width: 2; fill: color-mix(in srgb, var(--ink) 18%, transparent); }
.rating:not(.rated) .dot svg { animation: twinkleHero 2.6s ease-in-out infinite; animation-delay: calc(var(--i) * 140ms); }
@keyframes twinkleHero {
  0%, 45%, 100% { transform: scale(1.06); filter: drop-shadow(0 0 0 transparent); }
  56% { transform: scale(1.5) rotate(-14deg); filter: drop-shadow(0 0 12px color-mix(in srgb, var(--ink) 80%, transparent)); }
  66% { transform: scale(.95) rotate(7deg); }
  76% { transform: scale(1.22) rotate(-3deg); filter: drop-shadow(0 0 7px color-mix(in srgb, var(--ink) 55%, transparent)); }
  88% { transform: scale(1.06); filter: drop-shadow(0 0 0 transparent); }
}
.rating:not(.rated) .dot .burst i { animation: sparkIdle 2.6s ease-out infinite; animation-delay: calc(var(--i) * 140ms + 260ms); }
@keyframes sparkIdle {
  0% { opacity: 0; transform: translate(0, 0) scale(.4); }
  6% { opacity: .95; }
  26%, 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1); }
}

/* On select: filled stars pop one after another */
.dot.pop svg { animation: starPop .52s cubic-bezier(.3,1.6,.5,1) both; animation-delay: calc(var(--i) * 45ms); }
@keyframes starPop {
  0% { transform: scale(.55) rotate(-25deg); }
  55% { transform: scale(1.32) rotate(8deg); }
  100% { transform: scale(1.12) rotate(0); }
}
/* ...and the chosen star gives a tiny burst */
.dot .burst { position: absolute; inset: 0; pointer-events: none; }
.dot .burst i {
  position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; border-radius: 50%;
  background: var(--ink); opacity: 0;
}
.dot.burst-on .burst i { animation: spark .6s ease-out both; animation-delay: calc(var(--i) * 45ms + 120ms); }
.dot .burst i:nth-child(1) { --dx: 0px;   --dy: -24px; }
.dot .burst i:nth-child(2) { --dx: 21px;  --dy: -10px; }
.dot .burst i:nth-child(3) { --dx: 15px;  --dy: 19px; }
.dot .burst i:nth-child(4) { --dx: -15px; --dy: 19px; }
.dot .burst i:nth-child(5) { --dx: -21px; --dy: -10px; }
@keyframes spark {
  0% { opacity: 0; transform: translate(0, 0) scale(.4); }
  25% { opacity: .95; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1); }
}

.details { display: grid; gap: 14px; animation: in .4s ease; margin-bottom: 16px; }
.field { display: grid; gap: 6px; }
.label { font-size: 12px; font-weight: 700; letter-spacing: .4px; opacity: .9; }
textarea, input:not([type=file]) {
  width: 100%; border-radius: 16px; padding: 13px 15px;
  border: 1.5px solid color-mix(in srgb, var(--ink) 35%, transparent);
  background: color-mix(in srgb, var(--ink) 14%, transparent);
  outline: none; font-size: 16px; transition: border-color .2s, background .2s;
}
textarea { resize: none; line-height: 1.45; }
textarea::placeholder, input::placeholder { color: color-mix(in srgb, var(--ink) 65%, transparent); }
textarea:focus, input:focus { border-color: var(--ink); background: color-mix(in srgb, var(--ink) 20%, transparent); }
.private { display: grid; gap: 12px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 380px) { .row { grid-template-columns: 1fr; } }
.photos { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.attach {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1.5px dashed color-mix(in srgb, var(--ink) 60%, transparent);
  border-radius: 14px; padding: 10px 14px; font-size: 14px; font-weight: 700;
}
.attach input { display: none; }
.attach svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { position: relative; width: 52px; height: 52px; border-radius: 12px; overflow: hidden; background: rgba(0,0,0,.15); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; line-height: 20px; padding: 0; cursor: pointer;
}
.hint { margin: 0; font-size: 12.5px; opacity: .85; line-height: 1.45; }

.cta-wrap {
  position: sticky; bottom: 0; z-index: 2;
  margin: 0 -24px; padding: 18px 24px calc(12px + var(--safe-b));
  background: linear-gradient(to top, var(--to) 72%, color-mix(in srgb, var(--to) 0%, transparent));
}
.cta {
  width: 100%; min-height: 54px; border-radius: var(--radius); cursor: pointer;
  border: 2px solid var(--ink); background: transparent;
  font-weight: 800; font-size: 16px; letter-spacing: .3px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  text-decoration: none; transition: transform .15s, background .25s, color .25s, opacity .25s;
  backdrop-filter: blur(6px);
}
.cta:disabled { opacity: .5; cursor: not-allowed; }
.cta:not(:disabled):active { transform: scale(.98); }
.cta.solid, .cta.google { background: var(--ink); color: var(--to); }
.cta .g { width: 22px; height: 22px; background: #fff; border-radius: 50%; padding: 3px; }
.cta.wa { margin-top: 10px; max-width: 320px; color: var(--ink); }
.cta.wa svg { width: 22px; height: 22px; fill: #25D366; }
.cta.busy { pointer-events: none; opacity: .7; }

/* Done */
.done { justify-content: center; text-align: center; }
.done-inner { display: grid; justify-items: center; gap: 12px; }
.done h1 { margin: 8px 0 0; font-size: 32px; font-weight: 800; letter-spacing: -.5px; }
.done p { margin: 0; font-size: 16px; line-height: 1.55; opacity: .9; max-width: 34ch; }
.badge {
  width: 88px; height: 88px; border-radius: 50%; background: var(--ink); color: var(--to);
  display: grid; place-items: center; animation: pop .6s cubic-bezier(.3,1.6,.5,1);
}
.badge svg { width: 44px; height: 44px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
.socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.socials:empty { display: none; }
.socials .label { width: 100%; margin-bottom: 2px; }
.social {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--ink) 18%, transparent); color: var(--ink);
  text-decoration: none; font-weight: 700; font-size: 14px;
}
.social svg { width: 16px; height: 16px; fill: currentColor; }
.ghost { margin-top: 18px; background: none; border: 0; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; font-weight: 700; opacity: .85; }

/* Google sheet */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 10; background: rgba(10,10,15,.45);
  display: flex; align-items: flex-end; justify-content: center; animation: fade .2s;
}
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 460px; background: #fff; color: #1b1b1f; border-radius: 28px 28px 0 0;
  padding: 10px 24px calc(24px + var(--safe-b)); display: grid; justify-items: center; gap: 10px;
  animation: up .35s cubic-bezier(.2,.8,.2,1);
}
@keyframes up { from { transform: translateY(100%); } }
.grab { width: 40px; height: 5px; border-radius: 3px; background: #ddd; margin-bottom: 8px; }
.g-logo { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: #f3f4f6; }
.g-logo svg { width: 30px; height: 30px; }
.sheet h2 { margin: 4px 0 0; font-size: 22px; font-weight: 800; }
.steps { margin: 4px 0 8px; padding-left: 22px; justify-self: stretch; display: grid; gap: 8px; font-size: 15px; line-height: 1.4; color: #3b3b44; }
.sheet .cta.solid { background: linear-gradient(135deg, var(--from), var(--to)); color: #fff; border: 0; }
.link { background: none; border: 0; color: #6b6b76; font-weight: 600; cursor: pointer; padding: 8px; }

.toast {
  position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%); z-index: 20;
  background: rgba(20,20,25,.88); color: #fff; padding: 11px 18px; border-radius: 14px; font-size: 14px; font-weight: 600;
  max-width: calc(100% - 32px); text-align: center; animation: in .25s;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Review Finder / H&H attribution */
.powered {
  display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 14px;
  font-size: 12px; font-weight: 500; letter-spacing: .2px; opacity: .72;
}
.powered a { color: inherit; font-weight: 700; text-decoration: none; }
.powered .hh {
  width: 13px; height: 16px; flex: none; background: currentColor;
  -webkit-mask: url(brand/HH_Icon_White.png) center / contain no-repeat;
          mask: url(brand/HH_Icon_White.png) center / contain no-repeat;
}
.done .powered { position: absolute; left: 0; right: 0; bottom: calc(20px + var(--safe-b)); }

/* "Post it to Google" for low ratings (keeps every guest free to review on Google) */
.link-g { display: block; margin: 12px auto 0; background: none; border: 0; padding: 6px 10px; cursor: pointer; color: var(--ink); opacity: .85; font-size: 13.5px; font-weight: 600; }
.link-g u { text-underline-offset: 3px; }
.link-g:hover { opacity: 1; }
.sheet-text { margin: 0; color: #4b4b55; font-size: 15px; text-align: center; line-height: 1.5; }
.mgmt { justify-self: stretch; display: grid; gap: 4px; padding: 14px 16px; border-radius: 16px; background: #F4F5FA; border: 1px solid #E6E8F2; font-size: 14px; color: #4b4b55; line-height: 1.45; margin: 4px 0 6px; }
.mgmt b { color: #1b1b1f; font-size: 15px; }
.sheet .cta.outline { border: 2px solid var(--to); color: var(--to); background: #fff; }
.done .link-g { color: var(--ink); }

/* ---------- Language toggle + Arabic / RTL ---------- */
.top-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.lang {
  border: 1.5px solid color-mix(in srgb, var(--ink) 45%, transparent); background: color-mix(in srgb, var(--ink) 12%, transparent);
  border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 13px; font-weight: 700; line-height: 1.3;
}
.lang:hover { background: color-mix(in srgb, var(--ink) 22%, transparent); }
.lang[lang="ar"] { font-family: 'Noto Sans Arabic', sans-serif; }
.lang[lang="en"] { font-family: Urbanist, Arial, sans-serif; }
#missing .lang { justify-self: center; margin-bottom: 8px; }

html[lang="ar"] body { font-family: 'Noto Sans Arabic', Urbanist, Arial, sans-serif; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] .mood, html[lang="ar"] .cta, html[lang="ar"] .biz-name {
  font-family: 'Noto Kufi Arabic', 'Noto Sans Arabic', Urbanist, sans-serif;
}
/* Letter-spacing breaks Arabic letter joining */
html[lang="ar"] * { letter-spacing: 0 !important; }
html[lang="ar"] .headline { line-height: 1.35; font-size: clamp(26px, 7.2vw, 31px); }
html[lang="ar"] .skip { text-transform: none; font-size: 13px; }

/* Logical properties so the layout mirrors in Arabic */
.thumb button { right: auto; inset-inline-end: 2px; }
.steps { padding-left: 0; padding-inline-start: 22px; }

/* ---------- Quick-pick issues (low ratings) ---------- */
.issues { display: grid; gap: 8px; animation: in .35s ease; }
/* All issues visible at once: chips wrap onto rows (no sideways scrolling) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0; }
.chip {
  flex: 0 1 auto; display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 13px; border-radius: 999px; cursor: pointer; white-space: nowrap; font-size: 14.5px; font-weight: 700;
  border: 1.5px solid color-mix(in srgb, var(--ink) 40%, transparent);
  background: color-mix(in srgb, var(--ink) 12%, transparent); color: var(--ink);
  transition: background .2s, border-color .2s, color .2s, transform .15s;
  -webkit-tap-highlight-color: transparent;
}
.chip:active { transform: scale(.95); }
.chip-ic { font-size: 17px; line-height: 1; }
.chip-check { width: 0; height: 16px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; transition: width .2s; }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--to); }
.chip.on .chip-check { width: 16px; }
.chip.on .chip-check path { stroke-dasharray: 22; stroke-dashoffset: 22; animation: tick .35s .05s ease-out forwards; }
.chip.pop { animation: chipPop .4s cubic-bezier(.3,1.6,.5,1); }
@keyframes chipPop { 0% { transform: scale(.92); } 55% { transform: scale(1.07); } 100% { transform: scale(1); } }
@keyframes tick { to { stroke-dashoffset: 0; } }
.chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- Booking.com card (hotels, thank-you screen) ---------- */
.bk-card {
  width: 100%; max-width: 380px; margin-top: 10px; text-align: start; display: grid; gap: 8px;
  background: #fff; color: #1b1b1f; border-radius: 20px; padding: 18px 18px 14px; box-shadow: 0 12px 30px rgba(0,0,0,.18);
  animation: in .45s .15s both;
}
.bk-title { font-size: 16px; font-weight: 800; }
.bk-card p { margin: 0; font-size: 14px; line-height: 1.45; color: #4b4b55; opacity: 1; max-width: none; }
.bk-steps { margin: 0; padding-inline-start: 20px; display: grid; gap: 5px; font-size: 14px; line-height: 1.45; color: #2b2b33; }
.bk-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.bk-btn {
  flex: 1 1 140px; min-height: 42px; border-radius: 12px; border: 1.5px solid #d6d8e3; background: #fff; color: #1b1b1f;
  font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; padding: 0 12px;
}
.bk-btn.solid { background: #1b1b1f; border-color: #1b1b1f; color: #fff; }
.bk-card .bk-note { font-size: 12px; color: #75758a; }
html[lang="ar"] .bk-title { font-family: 'Noto Kufi Arabic', 'Noto Sans Arabic', sans-serif; }
.cta.track { margin-top: 10px; max-width: 320px; }
.track-hint { font-size: 14px !important; margin-top: -2px !important; }
.cta.track svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
