/* =========================================================================
   SIMAH Event Survey — kiosk styles
   Brand: SIMAH Brand Identity Guideline v3
   ========================================================================= */

/* ---- Brand typeface -----------------------------------------------------
   Drop RB-Light/Regular/Bold (.woff2) into assets/fonts/ and these kick in.
   Until then the stack falls back to IBM Plex Sans Arabic.
   ------------------------------------------------------------------------ */
@font-face {
  font-family: "RB";
  src: url("../fonts/RB-Light.woff2") format("woff2");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "RB";
  src: url("../fonts/RB-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "RB";
  src: url("../fonts/RB-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  /* Primary */
  --dark-blue:   #01426A;   /* Pantone 7694 C */
  --medium-blue: #256BA2;   /* Pantone 2151 C */
  --light-blue:  #2DCCD3;   /* Pantone 319 C  */
  --black:       #111821;
  --white:       #FFFFFF;

  /* Secondary */
  --green:       #009A17;
  --neon-green:  #01FEC1;
  --grey:        #A6A7A9;

  /* Tertiary */
  --red:         #D3001F;
  --orange:      #D77841;
  --yellow:      #FCBA63;

  --font: "RB", "IBM Plex Sans Arabic", -apple-system, BlinkMacSystemFont,
          "Segoe UI", Tahoma, sans-serif;

  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body.kiosk {
  font-family: var(--font);
  background: var(--dark-blue);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

/* ---- Background ---------------------------------------------------------- */

.bg-art {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(115deg,
      #00C8D4 0%,
      #14A8C6 28%,
      #256BA2 62%,
      #01426A 100%);
}

/* The angular shapes from the brand deck */
.bg-art::before,
.bg-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--dark-blue);
}
.bg-art::before {
  opacity: .16;
  clip-path: polygon(58% 0, 100% 0, 100% 100%, 88% 100%);
}
.bg-art::after {
  opacity: .10;
  clip-path: polygon(0 78%, 62% 100%, 0 100%);
}

/* ---- Layout -------------------------------------------------------------- */

.stage {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(1.25rem, 3.5vh, 3rem);
  padding: clamp(1.5rem, 4vh, 4rem) clamp(1.5rem, 5vw, 5rem);
  text-align: center;
  transition: opacity .45s var(--ease), transform .45s var(--ease);
}

body.is-thanking .stage {
  opacity: 0;
  transform: scale(.97);
  pointer-events: none;
}

/* ---- Brand --------------------------------------------------------------- */

.brand { display: flex; justify-content: center; }

.brand__logo {
  height: clamp(48px, 7vh, 88px);
  width: auto;
  filter: drop-shadow(0 2px 14px rgba(1, 66, 106, .35));
}

/* ---- Prompt -------------------------------------------------------------- */

.prompt {
  display: grid;
  gap: clamp(.35rem, 1vh, .85rem);
  width: 100%;
}

.prompt__title {
  margin: 0;
  font-size: clamp(1.6rem, 3.4vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
  text-wrap: balance;
  text-shadow: 0 2px 24px rgba(1, 66, 106, .3);
}

.prompt__question {
  margin: 0;
  font-size: clamp(.95rem, 1.5vw, 1.35rem);
  font-weight: 300;
  line-height: 1.45;
  color: rgba(255, 255, 255, .92);
  max-width: 46ch;
  margin-inline: auto;
}

/* ---- Options ------------------------------------------------------------- */

.options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(.75rem, 1.8vw, 1.75rem);
  width: 100%;
  max-width: 1500px;
  margin-inline: auto;
}

.opt {
  --opt-color: var(--light-blue);

  display: grid;
  justify-items: center;
  align-content: center;
  gap: clamp(.5rem, 1.6vh, 1.4rem);

  min-height: clamp(180px, 34vh, 380px);
  padding: clamp(1rem, 2.5vh, 2.25rem) clamp(.5rem, 1.5vw, 1.5rem);

  font-family: inherit;
  background: var(--white);
  border: 3px solid transparent;
  border-radius: clamp(20px, 2.2vw, 34px);
  box-shadow: 0 18px 42px -18px rgba(1, 25, 45, .55);
  cursor: pointer;

  transition:
    transform .35s var(--ease),
    box-shadow .35s var(--ease),
    border-color .35s var(--ease);
}

.opt__face {
  display: block;
  color: var(--opt-color);
  width: clamp(64px, 9.5vw, 132px);
}
.opt__face svg { display: block; width: 100%; height: auto; }

.opt__label {
  font-size: clamp(1rem, 1.9vw, 1.85rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--dark-blue);
}

/* Pointer devices only — a kiosk finger shouldn't leave a stuck hover state */
@media (hover: hover) and (pointer: fine) {
  .opt:hover {
    transform: translateY(-8px);
    border-color: var(--opt-color);
    box-shadow: 0 30px 60px -22px rgba(1, 25, 45, .65);
  }
}

.opt:active,
.opt.is-pressed {
  transform: translateY(-4px) scale(.97);
  border-color: var(--opt-color);
}

.opt:focus-visible {
  outline: 4px solid var(--neon-green);
  outline-offset: 5px;
}

.options.is-locked .opt { pointer-events: none; }
.options.is-locked .opt:not(.is-chosen) { opacity: .38; }

.opt.is-chosen {
  border-color: var(--opt-color);
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--opt-color) 35%, transparent);
}

/* ---- Language toggle ----------------------------------------------------- */

.lang-toggle {
  position: fixed;
  z-index: 3;
  inset-block-start: clamp(1rem, 2.5vh, 2rem);
  inset-inline-end: clamp(1rem, 2.5vw, 2.5rem);

  padding: .7em 1.5em;
  font-family: inherit;
  font-size: clamp(.85rem, 1.25vw, 1.1rem);
  font-weight: 600;
  color: var(--white);

  background: rgba(255, 255, 255, .14);
  border: 1.5px solid rgba(255, 255, 255, .45);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.lang-toggle:active { transform: scale(.95); }
@media (hover: hover) and (pointer: fine) {
  .lang-toggle:hover { background: rgba(255, 255, 255, .26); }
}

body.is-thanking .lang-toggle { opacity: 0; pointer-events: none; }

/* Show only the string for the active language */
[data-when]            { display: none; }
body[data-lang="ar"] [data-when="ar"],
body[data-lang="en"] [data-when="en"] { display: inline; }

/* ---- Thank you ----------------------------------------------------------- */

.thanks {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 2rem;
  text-align: center;

  background: linear-gradient(135deg, #01426A 0%, #0A5E8C 55%, #14A8C6 100%);
  opacity: 0;
  visibility: hidden;
  transition: opacity .5s var(--ease), visibility .5s;
}

body.is-thanking .thanks { opacity: 1; visibility: visible; }

.thanks__inner {
  display: grid;
  justify-items: center;
  gap: clamp(1rem, 3vh, 2.25rem);
  transform: translateY(18px) scale(.94);
  opacity: 0;
  transition: transform .6s var(--ease) .12s, opacity .6s var(--ease) .12s;
}
body.is-thanking .thanks__inner { transform: none; opacity: 1; }

.thanks__check { width: clamp(96px, 16vh, 168px); height: auto; }

.thanks__ring {
  fill: none;
  stroke: var(--neon-green);
  stroke-width: 3.5;
  opacity: .5;
}
.thanks__tick {
  fill: none;
  stroke: var(--neon-green);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 46;
  stroke-dashoffset: 46;
}
body.is-thanking .thanks__tick {
  animation: tick .55s var(--ease) .3s forwards;
}
@keyframes tick { to { stroke-dashoffset: 0; } }

.thanks__title {
  margin: 0;
  font-size: clamp(2.25rem, 6vw, 5rem);
  font-weight: 700;
  line-height: 1.1;
}
.thanks__text {
  margin: 0;
  font-size: clamp(1.05rem, 2.2vw, 1.9rem);
  font-weight: 300;
  color: rgba(255, 255, 255, .9);
}

/* ---- Offline queue badge ------------------------------------------------- */

.net-badge {
  position: fixed;
  z-index: 5;
  inset-block-end: clamp(.75rem, 2vh, 1.5rem);
  inset-inline-start: clamp(.75rem, 2vw, 1.5rem);

  display: flex;
  align-items: center;
  gap: .6em;
  padding: .55em 1.1em;

  font-size: .8rem;
  font-weight: 600;
  color: var(--black);
  background: var(--yellow);
  border-radius: 999px;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .5);
}
.net-badge[hidden] { display: none; }

.net-badge b {
  display: grid;
  place-items: center;
  min-width: 1.6em;
  padding: .1em .4em;
  background: rgba(17, 24, 33, .16);
  border-radius: 999px;
}

/* ---- Responsive ---------------------------------------------------------- */

/* Portrait screens and tablets — 2 x 2 */
@media (max-aspect-ratio: 1/1), (max-width: 900px) {
  .options { grid-template-columns: repeat(2, 1fr); }
  .opt     { min-height: clamp(150px, 22vh, 280px); }
  .opt__face { width: clamp(56px, 16vw, 110px); }
  .opt__label { font-size: clamp(1rem, 4.2vw, 1.7rem); }
}

/* Short landscape screens — keep everything above the fold */
@media (max-height: 620px) and (min-aspect-ratio: 1/1) {
  .prompt__title { font-size: clamp(1.5rem, 4vw, 2.5rem); }
  .opt { min-height: 150px; }
  .brand__logo { height: 40px; }
}

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