/**
 * create-lite.css — generator-first "create" flow (SCRUM-119).
 * Faithful port of the approved Claude Design prototype
 * (docs/design-reference/WishApp.dc.html): warm off-white, violet brand
 * gradient, pill buttons, single column, mobile-first, RTL-safe (logical
 * properties throughout). Scoped under .cl-app — no bleed into the theme.
 */

/* ---- page shell ------------------------------------------------------ */
.cl-body {
  margin: 0;
  background: #f5f3f0;
  color: #313330;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}
.cl-app {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
.cl-col { width: 100%; max-width: 560px; margin: 0 auto; }
.cl-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* ---- animations ------------------------------------------------------ */
@keyframes cl-float { 0% { transform: translateY(0); } 100% { transform: translateY(-8px); } }
@keyframes cl-rise  { 0% { opacity: 0; transform: translateY(14px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes cl-pop   { 0% { opacity: 0; transform: scale(0.92); } 100% { opacity: 1; transform: scale(1); } }
@keyframes cl-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes cl-blink { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
@keyframes cl-fall  { 0% { transform: translateY(-16px) rotate(0deg); opacity: 1; } 100% { transform: translateY(70vh) rotate(340deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .cl-app *, .cl-app *::before, .cl-app *::after { animation: none !important; transition: none !important; }
}

/* ---- screens --------------------------------------------------------- */
/* No animation by default: JS adds .cl-anim only on a REAL screen change.
   In-place re-renders (pill toggles, variant tabs) must not replay it. */
.cl-screen { display: none; flex: 1; flex-direction: column; }
.cl-screen.cl-anim { animation: cl-rise 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.cl-screen.is-active { display: flex; }
/* flex: 0 1 auto (NOT flex: 1): the CTA must sit right after the last field.
   flex: 1 stretched the scroll area to fill the viewport, leaving a big empty
   gap between the form and the Next/Generate button on short forms. */
.cl-scroll { flex: 0 1 auto; overflow-y: auto; padding: 6px 20px 12px; scrollbar-width: none; }
.cl-scroll::-webkit-scrollbar { width: 0; height: 0; }

/* ---- home ------------------------------------------------------------ */
.cl-home { padding: 18px 20px 22px; }
.cl-brandrow { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.cl-brandrow a { display: flex; align-items: center; gap: 9px; text-decoration: none; color: inherit; }
.cl-brandname { font-weight: 700; font-size: 16px; letter-spacing: -0.02em; }
.cl-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 4px 6px; }
.cl-mascot { animation: cl-float 3s ease-in-out infinite alternate; }
.cl-tagline { margin: 14px 0 0; font-size: 19px; line-height: 1.5; font-weight: 500; color: #313330; max-width: 300px; text-wrap: pretty; }
.cl-grid-title { font-size: 12.8px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; color: #5e5f5c; margin: 22px 2px 12px; }
.cl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 11px; }
.cl-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  min-height: 80px; padding: 14px 10px; text-align: center;
  background: #fff; border: 1px solid rgba(178, 178, 174, 0.35); border-radius: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); cursor: pointer; font-family: inherit;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
}
.cl-tile:hover, .cl-tile:focus-visible { transform: translateY(-4px); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07); }
.cl-tile-emoji { font-size: 26px; line-height: 1; }
.cl-tile-label { font-weight: 600; font-size: 14.5px; color: #313330; }
.cl-home-foot { margin-top: 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cl-legal { display: flex; gap: 14px; font-size: 12px; color: #9a9a96; }
.cl-legal a { color: inherit; text-decoration: none; }
.cl-legal a:hover { color: #6050b0; }

/* ---- step headers ---------------------------------------------------- */
.cl-stephead { padding: 16px 20px 10px; }
.cl-headrow { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cl-back {
  width: 34px; height: 34px; border-radius: 100px; flex: none;
  border: 1px solid rgba(178, 178, 174, 0.5); background: #fff; color: #5e5f5c;
  font-size: 17px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.cl-steplabel { font-size: 12.8px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; color: #6050b0; }
.cl-headspacer { flex: 1; }
.cl-titlerow { display: flex; align-items: center; gap: 11px; }
.cl-title-emoji { font-size: 26px; line-height: 1; }
.cl-h2 { font-size: 23px; font-weight: 800; letter-spacing: -0.03em; margin: 0; line-height: 1.1; }
.cl-occ-select-wrap { position: relative; display: inline-flex; align-items: center; margin-top: 11px; }
.cl-occ-select {
  appearance: none; -webkit-appearance: none;
  padding: 8px 36px 8px 15px; border: 1px solid rgba(178, 178, 174, 0.55); border-radius: 100px;
  font-family: inherit; font-size: 13px; font-weight: 600; color: #5e5f5c; background: #fff; cursor: pointer;
}
[dir="rtl"] .cl-occ-select { padding: 8px 15px 8px 36px; }
.cl-occ-caret { position: absolute; inset-inline-end: 15px; top: 50%; transform: translateY(-50%); pointer-events: none; color: #9a9a96; font-size: 11px; }

/* ---- fields ---------------------------------------------------------- */
.cl-field { margin-bottom: 15px; }
.cl-label {
  display: flex; gap: 7px; align-items: baseline;
  font-size: 12.8px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
  color: #313330; margin-bottom: 8px;
}
.cl-optional { text-transform: none; letter-spacing: 0; font-weight: 500; color: #a8a8a3; font-size: 11.5px; }
.cl-input, .cl-textarea {
  width: 100%; box-sizing: border-box; min-height: 52px; padding: 14px 16px;
  border: 1px solid rgba(178, 178, 174, 0.55); border-radius: 14px;
  font-family: inherit; font-size: 16px; line-height: 1.5;
  background: #fff; color: #313330; outline: none; -webkit-appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.cl-textarea { min-height: 92px; resize: none; line-height: 1.55; }
.cl-input:focus, .cl-textarea:focus { border-color: #6050b0; box-shadow: 0 0 0 3px rgba(96, 80, 176, 0.16); }
.cl-pills { display: flex; gap: 9px; flex-wrap: wrap; }
.cl-pill {
  padding: 12px 20px; min-height: 46px; border-radius: 100px;
  border: 1px solid rgba(178, 178, 174, 0.55); background: #fff; color: #5e5f5c;
  font-weight: 600; font-size: 14.5px; cursor: pointer; font-family: inherit;
}
.cl-pill.is-active { border-color: transparent; background: #6050b0; color: #fff; }

/* ---- sticky CTA ------------------------------------------------------ */
.cl-cta-wrap { padding: 12px 20px 22px; background: linear-gradient(to top, #f5f3f0 62%, rgba(245, 243, 240, 0)); }
.cl-cta {
  width: 100%; min-height: 54px; padding: 15px 24px; border: none; border-radius: 100px;
  background: linear-gradient(135deg, #6050b0 0%, #c4b8ff 100%); color: #fff;
  font-family: inherit; font-size: 16px; font-weight: 600; cursor: pointer;
  box-shadow: 0 12px 24px -6px rgba(96, 80, 176, 0.35);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 9px;
}
.cl-cta:hover, .cl-cta:focus-visible { transform: translateY(-2px); box-shadow: 0 16px 32px -6px rgba(96, 80, 176, 0.45); }
.cl-cta:disabled { opacity: 0.6; cursor: default; transform: none; }
.cl-cta--home { max-width: 230px; margin-top: 18px; }
.cl-quota { text-align: center; font-size: 12.5px; color: #a0a09b; margin-top: 10px; min-height: 1em; }
.cl-app :focus-visible { outline: 2px solid #6050b0; outline-offset: 2px; }
.cl-cta:focus-visible, .cl-pill:focus-visible, .cl-tile:focus-visible { outline-offset: 3px; }

/* ---- step 2 ---------------------------------------------------------- */
.cl-reqcard {
  background: #fff; border: 1px solid rgba(178, 178, 174, 0.35); border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); padding: 15px 16px 14px;
}
.cl-reqhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.cl-reqtitle { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; color: #6050b0; }
.cl-linkbtn { background: none; border: none; color: #6050b0; font-weight: 600; font-size: 13.5px; cursor: pointer; font-family: inherit; padding: 0; }
.cl-reqtext { font-size: 15px; line-height: 1.6; color: #313330; margin: 0; white-space: pre-wrap; }
.cl-reqedit {
  width: 100%; box-sizing: border-box; min-height: 104px; padding: 12px 14px;
  border: 1px solid rgba(178, 178, 174, 0.55); border-radius: 12px;
  font-family: inherit; font-size: 15px; line-height: 1.55; background: #faf9f7; color: #313330;
  outline: none; resize: none;
}
.cl-reqedit:focus { border-color: #6050b0; box-shadow: 0 0 0 3px rgba(96, 80, 176, 0.16); }
.cl-group { margin-top: 20px; }

/* ---- result ---------------------------------------------------------- */
.cl-variants { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.cl-var {
  width: 38px; height: 38px; border-radius: 100px; flex: none;
  border: 1px solid rgba(178, 178, 174, 0.55); background: #fff; color: #5e5f5c;
  font-weight: 700; font-size: 15px; cursor: pointer; font-family: inherit;
}
.cl-var.is-active { border: none; background: #6050b0; color: #fff; }
.cl-var--add {
  border: 1.5px dashed rgba(96, 80, 176, 0.5); background: rgba(196, 184, 255, 0.14);
  color: #6050b0; font-weight: 600; font-size: 20px; line-height: 1;
}
.cl-var--busy { display: flex; align-items: center; justify-content: center; color: #6050b0; font-size: 17px; animation: cl-blink 1s ease-in-out infinite; cursor: default; }

/* aurora / rose / marble frames around the wish card */
.cl-frame { border-radius: 26px; padding: 5px; transition: background 0.3s; }
.cl-frame--aurora { background: linear-gradient(135deg, #6050b0 0%, #c4b8ff 55%, #8f7fd8 100%); }
.cl-frame--rose   { background: linear-gradient(135deg, #d96a8b 0%, #ffc9d6 60%, #e88aa5 100%); }
.cl-frame--marble { background: linear-gradient(135deg, #cfcbc2 0%, #f2efe8 55%, #b9b4a8 100%); }
.cl-card { background: #fff; border-radius: 22px; padding: 22px 22px 24px; box-shadow: 0 6px 30px rgba(96, 80, 176, 0.10); }
.cl-wish { white-space: pre-wrap; font-size: 16.5px; line-height: 1.75; color: #313330; margin: 0; }

.cl-skel { display: flex; flex-direction: column; gap: 11px; }
.cl-skel-line {
  height: 15px; border-radius: 6px;
  background: linear-gradient(90deg, #efeaff 25%, #e2daff 50%, #efeaff 75%);
  background-size: 200% 100%; animation: cl-shimmer 1.3s linear infinite;
}
.cl-skel-note { font-size: 13px; color: #8a86c4; margin-top: 6px; display: flex; align-items: center; gap: 7px; }
.cl-skel-note span { animation: cl-blink 1.1s ease-in-out infinite; }

.cl-actions { display: flex; gap: 10px; margin-top: 16px; }
.cl-btn {
  flex: 1; min-height: 50px; padding: 13px 16px; border-radius: 100px;
  border: 1px solid rgba(178, 178, 174, 0.55); background: #fff; color: #313330;
  font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.cl-btn .is-ok { color: #10b981; }
.cl-btn--primary {
  border: none; background: linear-gradient(135deg, #6050b0 0%, #c4b8ff 100%); color: #fff;
  box-shadow: 0 10px 20px -6px rgba(96, 80, 176, 0.4);
}
.cl-btn--primary:hover { transform: translateY(-2px); box-shadow: 0 14px 26px -6px rgba(96, 80, 176, 0.5); }

.cl-swatches { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.cl-swatch { width: 30px; height: 30px; border-radius: 100px; border: 2px solid transparent; cursor: pointer; padding: 0; }
.cl-swatch.is-active { border-color: #313330; box-shadow: 0 0 0 2px #fff inset; }
.cl-swatch--aurora { background: linear-gradient(135deg, #6050b0, #c4b8ff); }
.cl-swatch--rose   { background: linear-gradient(135deg, #d96a8b, #ffc9d6); }
.cl-swatch--marble { background: linear-gradient(135deg, #cfcbc2, #f2efe8); }
.cl-resultlinks { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 22px; }
.cl-dot { color: #cfcdc8; }
.cl-resultfoot { padding: 10px 20px 20px; text-align: center; }
.cl-signup {
  font-size: 12.5px; color: #6050b0; background: rgba(196, 184, 255, 0.3);
  display: inline-block; padding: 7px 15px; border-radius: 100px; margin-top: 8px;
  text-decoration: none;
}

/* ---- welcome toast --------------------------------------------------- */
/* Body-level overlays (welcome, send sheet, confetti, toast) must sit ABOVE
   the generator modal (.cl-modal z-index 9990) when create-lite runs inside
   it — otherwise the send sheet opens BEHIND the modal. On the standalone
   /create/ page there's no modal, so the high z-index is harmless. */
.cl-welcome {
  position: fixed; inset-inline: 18px; top: 62px; z-index: 9998;
  display: flex; gap: 11px; align-items: center;
  background: #fff; border: 1px solid rgba(178, 178, 174, 0.35); border-radius: 16px;
  padding: 12px 15px; box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12); cursor: pointer;
  animation: cl-pop 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 560px; margin-inline: auto;
  font-size: 13.5px; line-height: 1.5; color: #313330;
}

/* ---- send sheet ------------------------------------------------------ */
.cl-sheet-backdrop {
  position: fixed; inset: 0; background: rgba(47, 47, 49, 0.45); z-index: 9996;
  display: flex; flex-direction: column; justify-content: flex-end;
  animation: cl-pop 0.2s ease;
}
.cl-sheet {
  background: #fff; border-radius: 24px 24px 0 0; padding: 12px 20px 24px;
  animation: cl-rise 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 600px; width: 100%; margin: 0 auto; box-sizing: border-box;
}
.cl-sheet-grip { width: 40px; height: 4px; border-radius: 100px; background: #dedcd6; margin: 2px auto 16px; }
.cl-sheet-title { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 16px; }
.cl-channels { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cl-channel {
  display: flex; align-items: center; gap: 11px; padding: 14px 15px;
  border-radius: 16px; border: 1px solid rgba(178, 178, 174, 0.45); background: #fff;
  color: #313330; font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  text-decoration: none;
}
.cl-ch-ic {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.cl-ch-ic svg { width: 19px; height: 19px; display: block; }
.cl-ch-ic--email { background: rgba(96, 80, 176, 0.12); color: #6050b0; }
.cl-ch-ic--wa    { background: rgba(37, 211, 102, 0.14); color: #1faa52; }
.cl-ch-ic--tg    { background: rgba(41, 171, 226, 0.14); color: #1f92c4; }
.cl-ch-ic--link  { background: rgba(122, 87, 68, 0.13); color: #7a5744; }
.cl-ch-ic--eye   { background: rgba(239, 71, 111, 0.12); color: #d43d63; }
.cl-sheet-open { display: block; text-align: center; margin-top: 16px; color: #6050b0; font-weight: 600; font-size: 14px; text-decoration: none; }

/* ---- send sheet: contact + schedule fields ---------------------------- */
/* intl-tel-input adaptation (project palette only — layout is the lib's). */
.cl-sheet .iti { width: 100%; display: block; }
.cl-sheet .iti input[type="tel"] { width: 100%; }
.iti__country-list { z-index: 10020; }
/* Date + time side by side under the schedule toggle. */
.cl-sched-row { display: flex; gap: 10px; margin-top: 10px; }
.cl-sched-row .cl-field-half { flex: 1 1 0; min-width: 0; }
.cl-sched-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600; color: #9a9a96; margin: 0 2px 5px; }
/* air-datepicker + its overlay must sit ABOVE the send sheet (9996) and the
   generator modal (9990). The lib's defaults are z-index 100/99. The classic
   time picker ships its own 1000100+ z-index — already fine. */
.air-datepicker-global-container { z-index: 10010; }
.air-datepicker.-is-mobile- { z-index: 10012; }
.air-datepicker-overlay { z-index: 10008; }

/* ---- toast + confetti ------------------------------------------------ */
.cl-toast-wrap { position: fixed; inset-inline: 0; bottom: 28px; z-index: 9999; display: flex; justify-content: center; pointer-events: none; }
.cl-toast {
  display: flex; align-items: center; gap: 9px;
  background: #2f2f31; color: #fff; padding: 12px 18px; border-radius: 100px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2); font-size: 14px; font-weight: 600;
  animation: cl-pop 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.cl-toast .is-ok { color: #7fe3b0; }
.cl-confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 9994; }
.cl-confetti span { position: absolute; top: 0; width: 8px; height: 12px; border-radius: 2px; animation: cl-fall 1.6s ease-in forwards; }

/* ---- compact desktop -------------------------------------------------- */
@media (min-width: 900px) {
  .cl-app { padding-top: 12px; }
}

/* ---- modal shell (site-wide overlay generator, SCRUM-123) ------------- */
/* When the header "Generate wish" CTA (or any #generator link) opens the
   generator as an overlay instead of the /create/ page, create-lite mounts
   into #cl-app inside this modal. Mobile = fullscreen sheet; desktop =
   centered card. The modal has its own close button + backdrop, so the
   in-app brand row is hidden to avoid a double logo. */
@keyframes cl-fade { from { opacity: 0; } to { opacity: 1; } }
/* The OVERLAY is the scroller (like a normal page), NOT the window: the
   window grows to its natural content height and the whole surface scrolls.
   No inner scrollbars inside the modal. */
.cl-modal {
  position: fixed; inset: 0; z-index: 9990;
  overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.cl-modal[hidden] { display: none; }
.cl-modal-backdrop {
  position: fixed; inset: 0; background: rgba(20, 18, 30, 0.55);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: cl-fade 0.2s ease;
}
.cl-modal-window {
  position: relative; margin: 0 auto; background: #f5f3f0;
  width: 100%; max-width: 600px; min-height: 100dvh;
  display: flex; flex-direction: column;
  animation: cl-rise 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (min-width: 620px) {
  .cl-modal-window {
    margin: 40px auto; min-height: 0; border-radius: 24px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  }
}
/* Zero-height sticky bar keeps the close button visible while the overlay
   scrolls a tall window. */
.cl-modal-xbar { position: sticky; top: 10px; z-index: 6; height: 0; }
.cl-modal-x {
  position: absolute; top: 2px; inset-inline-end: 12px;
  width: 40px; height: 40px; border: none; border-radius: 100px;
  background: rgba(255, 255, 255, 0.92); color: #5e5f5c; font-size: 24px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}
.cl-modal-x:hover { color: #313330; }
/* Inside the modal: natural height, page-level scroll — kill the inner
   scroll area; the sticky brand row is redundant with the modal chrome. */
.cl-app--modal { min-height: 0; height: auto; }
.cl-app--modal .cl-brandrow { display: none; }
.cl-app--modal .cl-scroll { overflow-y: visible; }
/* The small corner mascot in the step header peeks out from under the
   modal's close button — hide it in modal mode (the standalone /create/
   page has no close button, so it stays there). The hero mascot on the
   home screen is unaffected (it lives in .cl-hero, not .cl-headrow).
   !important: the mascot <img> carries an inline display:block. */
.cl-app--modal .cl-headrow img { display: none !important; }
html.cl-modal-open, body.cl-modal-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  .cl-modal-backdrop, .cl-modal-window { animation: none !important; }
}
