/* ==========================================================================
   AL BARAKA CLUB — "The membership card"
   The visitor makes a card rather than filling in a form: the name appears on
   it as they type, and on joining it flips to show the welcome-gift code.
   New components: membership card (.cl-card, two faces), perk (.cl-perk).
   ========================================================================== */

.cl-hero { position: relative; overflow: hidden; isolation: isolate; background: var(--purple); }
.cl-hero-swirl { position: absolute; z-index: -1; inline-size: clamp(30rem, 18rem + 46vw, 62rem); inset-block-start: 50%; inset-inline-end: -10%; transform: translateY(-50%) rotate(-8deg); color: var(--purple-swirl); }
.cl-hero-swirl .symbol { inline-size: 100%; }
.cl-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 1rem + 5vw, 6rem); align-items: center; padding-block: clamp(2.5rem, 1.5rem + 4.5vw, 5.5rem); }
.cl-copy { display: grid; gap: 1.25rem; justify-items: start; }
.cl-copy .display { font-size: clamp(2.75rem, 1.6rem + 4.6vw, 5.25rem); }
.cl-copy .lead { max-inline-size: 32rem; }
.cl-form { inline-size: min(100%, 30rem); margin-block-start: 0.5rem; padding: clamp(1.25rem, 1rem + 1.4vw, 2rem); border-radius: var(--r-lg); background: var(--isabella); color: var(--purple); box-shadow: var(--shadow-lift); }
.cl-form form { display: grid; gap: 1rem; }
/* The one worry at the moment of joining, answered under the button */
.cl-reassure { display: flex; align-items: center; justify-content: center; gap: 0.45rem; margin-block-start: -0.25rem; font-size: var(--fs-small); color: var(--ink-soft); text-align: center; }
.cl-reassure .ic { flex: none; inline-size: 1.05rem; block-size: 1.05rem; color: var(--success); }
.cl-form .success p { color: var(--ink-soft); }
.cl-form .success .btn-light { --btn-bg: var(--purple); --btn-fg: var(--isabella); }

/* --- The card ----------------------------------------------------------------- */
.cl-stage { display: grid; justify-items: center; gap: 1.75rem; perspective: 1400px; }
.cl-card { position: relative; inline-size: min(100%, 27rem); aspect-ratio: 1.586; transform-style: preserve-3d; transform: rotate(-6deg); transition: transform 0.9s var(--ease); }
/* The shadow lives on the faces: a filter on the card itself would flatten the 3D flip. */
[dir="rtl"] .cl-card { transform: rotate(6deg); }
.cl-stage:hover .cl-card { transform: rotate(-3deg) translateY(-6px); }
[dir="rtl"] .cl-stage:hover .cl-card { transform: rotate(3deg) translateY(-6px); }
.cl-card.is-flipped, [dir="rtl"] .cl-card.is-flipped, .cl-stage:hover .cl-card.is-flipped { transform: rotateY(180deg) rotate(4deg); }
.cl-face { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(1.1rem, 0.8rem + 1.4vw, 1.75rem); border-radius: 1.5rem; overflow: hidden; isolation: isolate; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 40px 50px -18px rgba(0, 0, 0, 0.55); }
.cl-card-swirl { position: absolute; z-index: -1; inline-size: 78%; inset-block-end: -42%; inset-inline-end: -14%; transform: rotate(-12deg); }
.cl-card-swirl .symbol { inline-size: 100%; }

.cl-front { background: var(--flamingo); color: #fff; }
.cl-front .cl-card-swirl { color: var(--purple); }
.cl-card-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.cl-card-top img { block-size: clamp(2rem, 1.6rem + 1.4vw, 2.75rem); inline-size: auto; }
.cl-card-bottom { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.cl-face small { display: block; font-size: var(--fs-tiny); font-weight: 600; opacity: 0.85; }
[dir="rtl"] .cl-face small { font-size: var(--fs-small); }
.cl-card-name { display: block; font-size: clamp(1.375rem, 1.1rem + 1.2vw, 2rem); font-weight: 800; line-height: 1.2; max-inline-size: 15rem; overflow-wrap: anywhere; transition: opacity var(--t-fast); }
.cl-card-name.is-empty { opacity: 0.55; }
.cl-card-no { text-align: end; }
.cl-card-no b { display: block; font-size: 1.125rem; font-weight: 800; letter-spacing: 0.06em; }
[dir="rtl"] .cl-card-no b { text-align: left; }

.cl-back { background: var(--isabella); color: var(--purple); transform: rotateY(180deg); justify-content: center; gap: 0.5rem; align-items: start; }
.cl-back .cl-card-swirl { color: var(--sand); }
.cl-gift { font-size: clamp(1.25rem, 1rem + 1.1vw, 1.75rem); font-weight: 800; line-height: 1.25; color: var(--flamingo); }
.cl-code { display: flex; align-items: center; gap: 0.9rem; margin-block: 0.35rem; padding: 0.55rem 0.6rem 0.55rem 1.1rem; border-radius: var(--r-md); background: var(--purple); color: var(--isabella); border: 2px dashed rgba(248, 241, 230, 0.4); }
.cl-code span { font-size: clamp(1.125rem, 0.9rem + 1vw, 1.5rem); font-weight: 800; letter-spacing: 0.08em; }
.cl-code .ic { inline-size: 2.25rem; block-size: 2.25rem; padding: 0.3rem; border-radius: 0.5rem; background: var(--isabella); color: var(--purple); }
.cl-stage-note { color: var(--on-dark-soft); font-size: var(--fs-small); text-align: center; }
.cl-card.is-flipped + .cl-stage-note { visibility: hidden; }

@media (max-width: 900px) {
  .cl-hero-grid { grid-template-columns: 1fr; }
  /* On a phone (the QR case) the card sits right under the headline, form straight after. */
  .cl-copy { display: contents; }
  .cl-copy > .eyebrow { order: 1; } .cl-copy > h1 { order: 2; } .cl-copy > .lead { order: 3; }
  .cl-stage { order: 4; } .cl-form { order: 5; inline-size: 100%; }
  .cl-hero-grid { gap: 1.1rem; }
  .cl-card { inline-size: min(100%, 22rem); }
  .cl-stage { gap: 1rem; margin-block: 1rem 0.5rem; }
}

/* --- Perks ---------------------------------------------------------------------- */
.cl-perks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 1rem + 2.5vw, 3.5rem); }
.cl-perk { display: grid; justify-items: center; text-align: center; gap: 0.6rem; }
.cl-perk img { inline-size: 6.5rem; block-size: 6.5rem; margin-block-end: 0.5rem; transition: transform var(--t-med) var(--ease); }
.cl-perk:hover img { transform: translateY(-6px) rotate(-6deg); }
.cl-perk h3 { font-size: 1.5rem; font-weight: 800; }
.cl-perk p { color: var(--ink-soft); max-inline-size: 18rem; }
@media (max-width: 720px) { .cl-perks { grid-template-columns: 1fr; } .cl-perk { grid-template-columns: 4.5rem 1fr; justify-items: start; text-align: start; column-gap: 1rem; align-items: center; } .cl-perk img { grid-row: span 2; inline-size: 4.5rem; block-size: 4.5rem; margin: 0; } .cl-perk h3 { align-self: end; } .cl-perk p { align-self: start; } }

/* --- Rewards explainer (the client round) -------------------------------------- */
.cl-hero .cl-reassure { color: var(--on-dark-soft); justify-content: flex-start; margin: 0; }
.cl-hero .cl-reassure .ic { color: var(--lime); }
.cb-points { justify-self: center; inline-size: min(100%, 26rem); display: grid; gap: 0.9rem; padding: clamp(1.25rem, 1rem + 1.5vw, 2rem); border-radius: var(--r-xl); background: var(--isabella); color: var(--purple); box-shadow: 0 40px 70px -35px rgba(0, 0, 0, 0.7); transform: rotate(-2.5deg); }
[dir="rtl"] .cb-points { transform: rotate(2.5deg); }
.cb-points-title { font-size: 1.5rem; font-weight: 800; }
.cb-points-start { display: flex; align-items: baseline; gap: 0.6rem; padding: 0.75rem 1rem; border-radius: var(--r-md); background: var(--flamingo); color: #fff; font-weight: 700; }
.cb-points-start .num { font-size: 2.25rem; font-weight: 800; line-height: 1; }
.cb-points ul { display: grid; gap: 0.5rem; }
.cb-points li { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0.85rem; border-radius: var(--r-md); background: var(--paper); font-weight: 700; font-size: 1.125rem; }
.cb-points .pts { min-inline-size: 3.75rem; padding: 0.25rem 0.5rem; border-radius: var(--r-pill); background: var(--purple); color: var(--isabella); text-align: center; font-weight: 800; }
.cb-points small { color: var(--ink-mute); font-size: var(--fs-small); }
.cb-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; counter-reset: none; }
.cb-steps li { display: flex; align-items: flex-start; gap: 0.9rem; padding: 1.25rem; border-radius: var(--r-lg); background: var(--paper); border: 1.5px solid var(--sand); }
.cb-step-n { flex: none; inline-size: 2.75rem; block-size: 2.75rem; border-radius: 50%; display: grid; place-items: center; background: var(--flamingo); color: #fff; font-size: 1.25rem; font-weight: 800; }
.cb-steps li > span { display: grid; gap: 0.25rem; }
.cb-steps b { font-size: 1.1875rem; font-weight: 800; }
.cb-steps small { color: var(--ink-soft); font-size: var(--fs-small); }
.cb-ways { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cb-ways .cl-perk img { inline-size: 5rem; block-size: 5rem; }
.cb-ways .cl-perk h3 { font-size: 1.1875rem; }
@media (max-width: 900px) { .cb-steps { grid-template-columns: 1fr; } .cb-ways { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Tablet (761–900px): the round-1 rule above orders the old form; give the explainer its own order. */
@media (max-width: 900px) {
  .cl-copy > .eyebrow { order: 1; } .cl-copy > h1 { order: 2; } .cb-points { order: 3; }
  .cl-copy > .btn { order: 4; } .cl-copy > .cl-reassure { order: 5; } .cl-copy > .lead { order: 6; } .cl-copy > .note-dev { order: 7; }
}

/* === PHONE (≤ 760px) ======================================================
   First screen: the headline, the points card (the three rewards as tiles),
   then the join button within thumb reach. The three steps read across one
   card as a stepper; the ways to earn are 2-column tiles; the table QR sits
   small beside its explanation; the questions are tidy accordions.       */
@media (max-width: 760px) {
  /* Hero: one clear order (the 900px rule above still expects the old form) */
  .cl-hero-grid { gap: 0.9rem; padding-block: 1.5rem 2rem; }
  .cl-copy > .eyebrow { order: 1; }
  .cl-copy > h1 { order: 2; }
  .cb-points { order: 3; }
  .cl-copy > .btn { order: 4; }
  .cl-copy > .cl-reassure { order: 5; }
  .cl-copy > .lead { order: 6; }
  .cl-copy > .note-dev { order: 7; }
  .cl-copy .display { font-size: clamp(2.3rem, 1.9rem + 2.4vw, 2.7rem); }
  .cl-copy .lead { font-size: 0.98rem; line-height: 1.6; }
  .cl-copy > .btn { inline-size: 100%; min-block-size: 3.4rem; padding-inline: 1rem; font-size: 1.05rem; margin-block-start: 0.2rem; }
  .cl-hero .cl-reassure { justify-content: center; margin-block-start: -0.25rem; font-size: 0.85rem; }

  /* The points card: compact, the three rewards side by side */
  .cb-points { justify-self: stretch; inline-size: 100%; gap: 0.65rem; padding: 1rem; border-radius: var(--r-lg); margin-block: 0.35rem; transform: rotate(-1.5deg); }
  [dir="rtl"] .cb-points { transform: rotate(1.5deg); }
  .cb-points-title { font-size: 1.15rem; }
  .cb-points-start { padding: 0.55rem 0.9rem; }
  .cb-points-start .num { font-size: 1.85rem; }
  .cb-points ul { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; }
  .cb-points li { flex-direction: column; justify-content: start; gap: 0.4rem; padding: 0.65rem 0.35rem; text-align: center; font-size: 0.92rem; line-height: 1.3; }
  .cb-points .pts { min-inline-size: 3.25rem; font-size: 0.95rem; }
  .cb-points small { font-size: 0.78rem; }

  /* Steps: one card, three steps across, joined by a line */
  .cb-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; padding: 1.1rem 0.6rem 1rem; border-radius: var(--r-lg); background: var(--paper); border: 1.5px solid var(--sand); }
  .cb-steps li { position: relative; flex-direction: column; align-items: center; gap: 0.55rem; padding: 0; border: 0; border-radius: 0; background: none; text-align: center; }
  .cb-steps li + li::before { content: ""; position: absolute; inset-block-start: 1.1rem; inset-inline-end: calc(50% + 1.5rem); inline-size: calc(100% - 3rem + 0.4rem); block-size: 3px; margin-block-start: -1.5px; border-radius: 3px; background: var(--sand-deep); }
  .cb-step-n { inline-size: 2.2rem; block-size: 2.2rem; font-size: 1.05rem; }
  .cb-steps li > span { gap: 0.2rem; }
  .cb-steps b { font-size: 0.95rem; line-height: 1.3; }
  .cb-steps small { font-size: 0.8rem; line-height: 1.45; }
  .cb-steps + div { margin-block-start: 1rem !important; }
  .cb-steps + div .btn { inline-size: 100%; min-block-size: 3.4rem; }

  /* Ways to earn: 2-column tiles */
  .cb-ways { gap: 0.5rem; }
  .cb-ways .cl-perk { grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: start; gap: 0.5rem; padding: 0.9rem 0.6rem 1rem; border-radius: var(--r-md); background: var(--paper); border: 1.5px solid var(--sand); text-align: center; }
  .cb-ways .cl-perk img { grid-row: auto; inline-size: 3.25rem; block-size: 3.25rem; margin: 0; }
  .cb-ways .cl-perk h3 { align-self: start; font-size: 0.98rem; line-height: 1.35; }

  /* QR: the heading across, then the tent small beside the explanation */
  .qr-block { grid-template-columns: 8.5rem minmax(0, 1fr); gap: 0 1rem; align-items: center; }
  .qr-block > .stack { display: contents; }
  .qr-block .eyebrow { grid-column: 1 / -1; grid-row: 1; }
  .qr-block h2 { grid-column: 1 / -1; grid-row: 2; margin-block: 0.3rem 1.1rem; font-size: 1.6rem; }
  .qr-block .tent { grid-column: 1; grid-row: 3; inline-size: 100%; gap: 0.5rem; padding: 0.95rem 0.6rem 0.85rem; border-radius: var(--r-md); }
  .qr-block .lead { grid-column: 2; grid-row: 3; margin: 0; font-size: 0.95rem; line-height: 1.6; }
  .qr-block .note-dev { grid-column: 1 / -1; margin-block-start: 1rem; }
  .tent > .symbol { inline-size: 10rem; inset-block-end: -3.5rem; inset-inline-end: -3rem; }
  .tent img.logo { block-size: 1.35rem; }
  .tent b { font-size: 0.9rem; }
  .tent .qr { inline-size: 5.25rem; block-size: 5.25rem; padding: 0.45rem; border-radius: var(--r-sm); }
  .tent .chip { padding-inline: 0.55rem; font-size: 0.72rem; }

  /* Questions: tidy accordions */
  .acc { border-radius: var(--r-md); }
  .acc + .acc { margin-block-start: 0.5rem; }
  .acc summary { min-block-size: 3.4rem; gap: 0.75rem; padding: 0.7rem 1rem; font-size: 1.02rem; line-height: 1.4; }
  .acc summary .plus { inline-size: 2rem; block-size: 2rem; }
  .acc .content { padding: 0 1rem 1rem; font-size: 0.95rem; }
}
