/* ============================================================
   Mandate Story — premium 10s interactive loop
   ============================================================ */

.mandate-gif-wrap {
  position: relative;
  width: 100%;
  max-width: 820px;
  margin-inline: auto;
}

.mandate-gif {
  position: relative;
  width: 100%;
  border-radius: 26px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 12% -10%, rgba(76, 180, 212, 0.42), transparent 42%),
    radial-gradient(ellipse at 100% 110%, rgba(122, 201, 67, 0.16), transparent 40%),
    linear-gradient(155deg, #06131F 0%, #0C2438 38%, #134A62 72%, #0E3348 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 28px 70px rgba(7, 21, 35, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  z-index: 1;
  isolation: isolate;
}

.mandate-gif__glow {
  position: absolute;
  inset: -35%;
  background: radial-gradient(circle at 40% 30%, rgba(76, 180, 212, 0.4), transparent 52%);
  animation: gifGlow 6s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.mandate-gif__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}
.mandate-gif__orb--a {
  width: 180px;
  height: 180px;
  top: -40px;
  right: -30px;
  background: radial-gradient(circle, rgba(76, 180, 212, 0.35), transparent 68%);
  animation: orbFloat 9s ease-in-out infinite;
}
.mandate-gif__orb--b {
  width: 140px;
  height: 140px;
  bottom: 10%;
  left: -40px;
  background: radial-gradient(circle, rgba(122, 201, 67, 0.22), transparent 68%);
  animation: orbFloat 11s ease-in-out infinite reverse;
}

.mandate-gif__frame {
  position: relative;
  z-index: 1;
  padding: 1rem 1.25rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 440px;
}

/* Instagram-style segments */
.mandate-gif__segments {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
}
.mandate-gif__seg {
  display: block;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}
.mandate-gif__seg > i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4CB4D4, #7AC943);
  box-shadow: 0 0 10px rgba(76, 180, 212, 0.55);
}
.mandate-gif__seg.is-done > i { width: 100%; }
.mandate-gif__seg.is-active > i { width: var(--seg-pct, 0%); }

.mandate-gif__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.mandate-gif__brand-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.mandate-gif__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.mandate-gif__badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5BE0A0;
  animation: livePulse 1.6s ease-out infinite;
}
.mandate-gif__step {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.55);
  font-variant-numeric: tabular-nums;
}

.mandate-gif__controls {
  display: none;
}
.mandate-gif__timer {
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  font-variant-numeric: tabular-nums;
}
.mandate-gif__play {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}
.mandate-gif__play:hover {
  background: rgba(76, 180, 212, 0.28);
  border-color: rgba(76, 180, 212, 0.5);
  transform: scale(1.06);
}
.mandate-gif__play svg { width: 12px; height: 12px; }

.mandate-gif__progress { display: none; }

.mandate-gif__stage {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 300px;
}

.mg-scene {
  display: none;
  grid-template-columns: minmax(150px, 0.85fr) minmax(0, 1.2fr);
  gap: 1.25rem 1.5rem;
  align-items: center;
  width: 100%;
  opacity: 0;
  transform: translateY(14px) scale(0.985);
}
.mg-scene.is-active {
  display: grid;
  opacity: 1;
  transform: none;
  animation: sceneIn 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Phone */
.mg-phone {
  width: min(100%, 178px);
  margin-inline: auto;
  border-radius: 26px;
  background: linear-gradient(165deg, #0A1622 0%, #15293A 100%);
  padding: 9px;
  box-shadow:
    0 20px 44px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 0 0 6px rgba(76, 180, 212, 0.08);
  position: relative;
  flex-shrink: 0;
  animation: phoneFloat 5.5s ease-in-out infinite;
}
.mg-phone::after {
  content: '';
  position: absolute;
  inset: -14px;
  border-radius: 36px;
  background: radial-gradient(circle at 50% 12%, rgba(76, 180, 212, 0.5), transparent 62%);
  z-index: -1;
  opacity: 0.75;
}
.mg-phone__shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(125deg, rgba(255,255,255,0.16) 0%, transparent 34%, transparent 66%, rgba(255,255,255,0.05) 100%);
  pointer-events: none;
  z-index: 2;
}
.mg-phone__notch {
  width: 54px;
  height: 5px;
  border-radius: 5px;
  background: #1e3348;
  margin: 5px auto 8px;
  position: relative;
  z-index: 1;
}
.mg-phone__screen {
  position: relative;
  background:
    linear-gradient(180deg, #FFFFFF 0%, #F3FAFC 55%, #E8F4F8 100%);
  border-radius: 19px;
  padding: 0.8rem 0.72rem 0.9rem;
  min-height: 228px;
  overflow: hidden;
}
.mg-phone__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.28rem;
}
.mg-phone__brand {
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2A8FA8;
  margin: 0;
}
.mg-phone__live {
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1F8A6E;
  background: #E8F7F1;
  border: 1px solid rgba(31, 138, 110, 0.2);
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
}
.mg-phone__title {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 800;
  color: #0B1C2A;
  margin: 0 0 0.55rem;
  letter-spacing: -0.025em;
  line-height: 1.15;
}
.mg-phone__card {
  position: relative;
  background: #fff;
  border: 1px solid rgba(18, 48, 74, 0.08);
  border-radius: 12px;
  padding: 0.6rem 0.65rem;
  margin-bottom: 0.4rem;
  box-shadow: 0 6px 16px rgba(15, 40, 60, 0.05);
  overflow: hidden;
}
.mg-phone__card--accent {
  background: linear-gradient(145deg, #FFFFFF, #EAF8FB);
  border-color: rgba(76, 180, 212, 0.22);
}
.mg-phone__card .lbl {
  font-size: 0.56rem;
  color: #6B7A88;
  margin: 0 0 0.12rem;
}
.mg-phone__card .val {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 800;
  color: #0B1C2A;
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1.1;
}
.mg-phone__card .val em {
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 700;
  color: #6B7A88;
  letter-spacing: 0;
}
.mg-up { color: #1F8A6E !important; font-size: 0.75rem !important; }
.mg-phone__spark {
  position: absolute;
  right: 0.55rem;
  bottom: 0.5rem;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
}
.mg-phone__spark span {
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, #4CB4D4, #7AC943);
  animation: sparkBar 1.4s ease-in-out infinite;
}
.mg-phone__spark span:nth-child(1) { height: 40%; animation-delay: 0s; }
.mg-phone__spark span:nth-child(2) { height: 70%; animation-delay: 0.15s; }
.mg-phone__spark span:nth-child(3) { height: 55%; animation-delay: 0.3s; }
.mg-phone__spark span:nth-child(4) { height: 90%; animation-delay: 0.45s; }

.mg-phone__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.64rem;
  padding: 0.4rem 0.5rem;
  background: #fff;
  border-radius: 9px;
  margin-bottom: 0.28rem;
  border: 1px solid rgba(18, 48, 74, 0.06);
}
.mg-phone__row span:first-child { color: #6B7A88; }
.mg-phone__row span:last-child { font-weight: 700; color: #0B1C2A; }
.mg-good { color: #1F8A6E !important; }

.mg-approve {
  margin-top: 0.5rem;
  width: 100%;
  border: none;
  border-radius: 999px;
  min-height: 32px;
  background: linear-gradient(135deg, #4CB4D4, #2A8FA8);
  color: white;
  font-size: 0.68rem;
  font-weight: 800;
  font-family: var(--font-display);
  box-shadow: 0 10px 22px rgba(76, 180, 212, 0.4);
  cursor: default;
  position: relative;
  z-index: 1;
}
.mg-scene[data-scene="client"].is-active .mg-approve {
  animation: tapPulse 1.15s ease-in-out 0.4s 1;
}

.mg-phone__toast {
  position: absolute;
  left: 50%;
  bottom: 0.65rem;
  transform: translateX(-50%) translateY(120%);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: #0B1C2A;
  color: #fff;
  font-size: 0.58rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(11, 28, 42, 0.35);
  opacity: 0;
  z-index: 3;
}
.mg-phone__toast svg {
  width: 11px;
  height: 11px;
  color: #5BE0A0;
}
.mg-scene[data-scene="client"].is-active .mg-phone__toast {
  animation: toastIn 2.4s ease 0.85s 1 forwards;
}

/* Copy */
.mg-copy {
  color: white;
  min-width: 0;
  padding: 0.1rem 0;
}
.mg-role {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #7AD4EA;
  margin-bottom: 0.5rem;
}
.mg-role__icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(76, 180, 212, 0.16);
  border: 1px solid rgba(76, 180, 212, 0.28);
  color: #7AD4EA;
}
.mg-role__icon svg { width: 12px; height: 12px; }
.mg-copy h3 {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.1vw, 1.42rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.18;
  margin: 0 0 0.5rem;
  background: linear-gradient(135deg, #fff 30%, #B8E8F4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.mg-copy > p:not(.mg-role) {
  font-size: 0.82rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.72);
  margin: 0 0 0.85rem;
  max-width: 36ch;
}
.mg-benefits {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.mg-benefit {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.58rem 0.75rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.04));
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 0.76rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.96);
  line-height: 1.35;
  opacity: 0;
  transform: translateX(12px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  transition: border-color 0.25s, background 0.25s;
}
.mg-benefit:hover {
  border-color: rgba(76, 180, 212, 0.35);
  background: linear-gradient(135deg, rgba(76,180,212,0.16), rgba(255,255,255,0.06));
}
.mg-scene.is-active .mg-benefit {
  animation: benefitIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.mg-scene.is-active .mg-benefit:nth-child(1) { animation-delay: 0.12s; }
.mg-scene.is-active .mg-benefit:nth-child(2) { animation-delay: 0.24s; }
.mg-scene.is-active .mg-benefit:nth-child(3) { animation-delay: 0.36s; }
.mg-benefit__check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
  background: rgba(91, 224, 160, 0.16);
  border: 1px solid rgba(91, 224, 160, 0.35);
  color: #5BE0A0;
}
.mg-benefit__check svg { width: 11px; height: 11px; }

/* Labeled dots */
.mandate-gif__dots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.2rem;
  flex-shrink: 0;
}
.mandate-gif__dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: transform 0.25s, background 0.25s, border-color 0.25s, color 0.25s;
  font-family: var(--font-display);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.mandate-gif__dot span { pointer-events: none; }
.mandate-gif__dot.is-active {
  color: #0B1C2A;
  background: linear-gradient(90deg, #7AD4EA, #A8E06A);
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(76, 180, 212, 0.35);
}
.mandate-gif__dot:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
}

.mandate-gif__caption {
  text-align: center;
  margin-top: 0.9rem;
  font-size: 0.78rem;
  color: #6B7A88;
  font-weight: 550;
}
.mandate-gif__caption strong {
  color: #2A8FA8;
  font-weight: 700;
}

@keyframes sceneIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes gifGlow {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.06); }
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-12px, 10px); }
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(91, 224, 160, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(91, 224, 160, 0); }
  100% { box-shadow: 0 0 0 0 rgba(91, 224, 160, 0); }
}
@keyframes tapPulse {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(0.94); }
  70% { transform: scale(1.05); }
}
@keyframes benefitIn {
  to { opacity: 1; transform: none; }
}
@keyframes phoneFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes sparkBar {
  0%, 100% { transform: scaleY(0.7); opacity: 0.7; }
  50% { transform: scaleY(1); opacity: 1; }
}
@keyframes toastIn {
  0% { opacity: 0; transform: translateX(-50%) translateY(120%); }
  18%, 72% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(40%); }
}

@media (max-width: 720px) {
  .mandate-gif__frame {
    min-height: 0;
    padding: 0.9rem 0.95rem 1rem;
  }
  .mg-scene.is-active {
    grid-template-columns: 1fr;
    gap: 0.95rem;
    justify-items: center;
  }
  .mg-copy {
    text-align: center;
    padding: 0;
  }
  .mg-copy > p:not(.mg-role) { margin-inline: auto; }
  .mg-benefits { text-align: left; width: 100%; max-width: 340px; }
  .mg-role { justify-content: center; }
  .mg-phone { width: 164px; animation: none; }
  .mandate-gif__step { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .mandate-gif__glow,
  .mandate-gif__orb,
  .mandate-gif__badge i,
  .mg-approve,
  .mg-phone,
  .mg-phone__spark span,
  .mg-phone__toast,
  .mg-scene.is-active { animation: none !important; }
  .mg-scene.is-active .mg-benefit {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .mg-scene[data-scene="client"].is-active .mg-phone__toast {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}
