/* =====================================================
    GLOBAL BACKGROUND
===================================================== */
/* Page fade-in */
.page-fade {
    opacity: 0;
    animation: pageFadeIn 200ms ease-out forwards;
}

@keyframes pageFadeIn {
    to {
        opacity: 1;
    }
}

body {
  position: relative;
}

/* fixed background layer */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("/static/img/wp5957944.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -2;
}

/* Optional dark overlay to preserve contrast */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.55);
    z-index: -1;
}

/* =====================================================
    CORE LAYOUT / EFFECTS
===================================================== */
.glass {
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(10px);
}

.fade-in {
    animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-text-fill-color: rgb(241 245 249);
    transition: background-color 9999s ease-in-out 0s;
}

/* Prevent Tailwind override */
.font-semibold {
    font-weight: 400 !important;
}

/* =====================================================
    NAVIGATION
===================================================== */
.nav-link {
    position: relative;
    color: rgb(203 213 225);
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: rgb(129 140 248);
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -6px;
    width: 0;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        rgba(129, 140, 248, 0.9),
        transparent
    );
    transition: width 0.2s ease, left 0.2s ease;
}

.nav-link:hover::after {
    width: 100%;
    left: 0;
}

/* =====================================================
    WALLET PAY BUTTONS (ISOLATED — DO NOT TOUCH)
===================================================== */

/* Apple Pay (official) */
.apple-pay-button {
    -webkit-appearance: -apple-pay-button;
    -apple-pay-button-type: buy;
    -apple-pay-button-style: black;
    height: 44px;
    border-radius: 12px;
    padding: 0 !important;
    background: transparent !important;
}

/* Custom Google Pay button (NOT Square iframe) */
#google-pay-button {
    display: none;
}

.google-pay-custom {
    background: #000 !important;
    color: #fff;
    box-sizing: border-box !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 0 !important;
    margin: 0 !important;
    padding-left: 18px !important;
    padding-right: 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 12px;
    border: none;
}

.google-pay-custom:hover {
    background: #111;
}

.google-pay-custom:active {
    transform: scale(0.98);
}

.gpay-icon {
    display: flex;
    align-items: center;
    margin-right: 10px;
}

.google-pay-custom:hover,
.google-pay-custom:focus,
.google-pay-custom:focus-visible,
.google-pay-custom:active {
    background: #000 !important;
    outline: none;
}


/* =====================================================
    TIMER SCALING
===================================================== */
.timer-scale {
  transform: scale(1);
  transform-origin: center;
}

@media (min-width: 1024px) {
  .timer-scale {
    transform: scale(1.25);
  }
}

@media (min-width: 1280px) {
  .timer-scale {
    transform: scale(1.4);
  }
}


/* =====================================================
    CARD UI
===================================================== */
.card-wrapper {
    max-width: 360px;
    margin: 0 auto;
}

/* =====================================================
    MOBILE MENU
===================================================== */
.mobile-link {
    display: flex;
    align-items: center;
    padding: 0.9rem 1.25rem;
    font-size: 1.05rem;
    font-weight: 500;
    color: rgb(226 232 240);
    white-space: nowrap;
    transition: background-color 0.15s ease;
}

.mobile-link:hover {
    background: rgba(129, 140, 248, 0.08);
}


/* =====================================================
   BUTTON SYSTEM — BASE
===================================================== */

.btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 1rem;
  line-height: 1.2;

  font-size: 1rem;
  font-weight: 400;

  cursor: pointer;
  user-select: none;

  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.1s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* =====================================================
   BUTTON SIZES
===================================================== */

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
}

.btn-md {
  padding: 0.6rem 1.1rem;
  font-size: 1rem;
}

.btn-lg {
  padding: 0.8rem 1.4rem;
  font-size: 1.05rem;
}

/* Mobile ergonomics */
@media (max-width: 768px) {
  .btn-lg {
    padding: 1.05rem 1.4rem;
  }
}

/* =====================================================
   PRIMARY CTA BUTTON
===================================================== */

.btn-primary {
  background: linear-gradient(
    to right,
    rgb(79 70 229),
    rgb(124 58 237)
  );
  color: #ffffff;
  font-weight: 600;

  box-shadow: 0 12px 30px rgba(79, 70, 229, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(
    to right,
    rgb(99 102 241),
    rgb(139 92 246)
  );
}

/* =====================================================
   PAYMENT CTA BUTTON
===================================================== */

/* BASE payment button — DO NOT FORCE WIDTH */
.btn-pay {
  padding: 0.75rem 1.75rem;
  min-height: 3.25rem;

  background-color: rgb(79 70 229);
  color: #ffffff;

  border: 1px solid transparent;
  box-sizing: border-box;

  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.32);
}

.btn-pay:hover:not(:disabled) {
  background-color: rgb(99 102 241);
}

.btn-pay:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-pay-secondary {
  background-color: transparent;
  color: rgb(129 140 248);

  border-color: rgb(99 102 241);
  box-shadow: none;
}

.btn-pay-secondary:hover {
  background-color: rgba(99, 102, 241, 0.08);
  color: #ffffff;
}

/* PAYMENT CTA — constrained, centered */
.pay-cta {
  width: 10rem; 
  max-width: calc(100vw - 2rem);
}

/* Home hero CTA sizing ONLY */
.home-cta {
  width: 18rem;
  max-width: calc(100vw - 2rem);
  min-height: 3.25rem; 
  padding: 0.75rem 1.75rem;
}

@media (min-width: 640px) {
  .home-cta {
    width: 380px;
    max-width: 380px;
  }
}



/* =====================================================
   OUTLINED PRIMARY BUTTON (Indigo)
   ===================================================== */
.btn-outline-primary {
  border: 1px solid rgb(99 102 241); 
  color: rgb(129 140 248); 
  background-color: transparent;
  font-weight: 600;
  transition: background-color 0.2s ease,
              border-color 0.2s ease,
              color 0.2s ease;
}

.btn-outline-primary:hover {
  background-color: rgb(99 102 241 / 0.10);
}

.btn-outline-primary:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.btn-outline-danger {
  display: inline-flex;
  align-items: center;

  border-radius: 1rem;              
  border: 1px solid #ef4444;        
  color: #ef4444;

  font-weight: 400;

  padding: 0.5rem 1rem;            

  background-color: transparent;
  cursor: pointer;

  transition: background-color 0.15s ease;
}

.btn-outline-danger:hover {
  background-color: rgba(239, 68, 68, 0.1);
}


@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

#card-placeholder {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes softPulse {
  0%, 100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.animate-pulse-soft {
  animation: softPulse 1.4s ease-in-out infinite;
}

.workout-plan {
  transition: opacity 0.2s ease;
}

.is-generating .workout-plan {
  opacity: 0;
  pointer-events: none;
}

/* Smooth content swap */
.fade-swap {
  animation: fadeSwapIn 280ms ease-out both;
}

@keyframes fadeSwapIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.preview-done {
  filter: blur(6px) grayscale(40%);
  opacity: 0.6;
  transition: filter 300ms ease, opacity 300ms ease;
}


/* =====================================================
   MOBILE TYPOGRAPHY SCALING (GLOBAL)
===================================================== */
@media (max-width: 768px) {
  html {
    font-size: 106%;
  }
}

/* =====================
   MUSIC CONTROLS
===================== */
.music-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.music-btn {
  background: none;
  border: none;
  color: #ffffff;
  opacity: 0.85;
  cursor: pointer;
  padding: 12px;
  line-height: 0;
  transition: color 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
}

.music-btn:hover {
  opacity: 1;
}

.music-btn:active {
  transform: scale(0.95);
}

/* ACTIVE (playing / repeat on) */
.music-btn.active {
  color: #4f83ff; 
  opacity: 1;
}

/* SVG inherits color */
.music-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* Flip repeat icon (optional aesthetic) */
#musicRepeat svg {
  transform: scaleX(-1);
}

/* Utility */
.hidden {
  display: none;
}

/* 📱 Mobile tuning */
@media (max-width: 640px) {
  .music-controls {
    gap: 14px;
  }

  .music-btn {
    padding: 14px;
  }

  .music-btn svg {
    width: 24px;
    height: 24px;
  }
}

.music-controls-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

/* soft circular backdrop */
.music-controls-wrapper::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 9999px;
  background: radial-gradient(
    circle,
    rgba(99, 102, 241, 0.18) 0%,
    rgba(99, 102, 241, 0.08) 40%,
    rgba(99, 102, 241, 0.02) 65%,
    transparent 70%
  );
  z-index: 0;
}

/* keep buttons above the glow */
.music-controls {
  position: relative;
  z-index: 1;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fade-in 0.25s ease-out forwards;
}


/* --------------------------------------------------
   Fullscreen Hint Bubble
-------------------------------------------------- */
.fullscreen-hint {
  position: absolute;
  top: 3.5rem; 
  right: 1rem; 
  z-index: 30;

  max-width: 220px;
  padding: 0.5rem 0.75rem;

  border-radius: 0.75rem;

  background: linear-gradient(
    135deg,
    rgba(124, 58, 237, 0.92), 
    rgba(109, 40, 217, 0.92), 
    rgba(76, 29, 149, 0.92)  
  );

  color: #f5f3ff; 
  font-size: 0.75rem;
  line-height: 1.25;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  border: 1px solid rgba(255, 255, 255, 0.2);

  box-shadow:
    0 12px 40px rgba(88, 28, 135, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

/* Content styling */
.fullscreen-hint__em {
  font-weight: 600;
  color: #ffffff;
}

.fullscreen-hint__sub {
  color: #e9d5ff; /* violet-200 */
}

/* Optional subtle attention pulse */
.fullscreen-hint {
  animation: fullscreenHintPulse 3.5s ease-in-out infinite;
}

@keyframes fullscreenHintPulse {
  0%, 100% {
    transform: translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateY(-1px);
    opacity: 0.95;
  }
}

/* --------------------------------------------------
   Mobile override: Fullscreen Hint (top of screen)
-------------------------------------------------- */
@media (max-width: 639px) {
  .fullscreen-hint {
    position: fixed;
    top: env(safe-area-inset-top, 12px);
    left: 50%;
    right: auto;

    transform: translateX(-50%);
    z-index: 50;

    max-width: 90%;
    text-align: center;

    /* Slightly stronger visibility on mobile */
    box-shadow:
      0 16px 45px rgba(88, 28, 135, 0.65),
      inset 0 0 0 1px rgba(255, 255, 255, 0.15);
  }
}

/* =====================================================
   BRAND COLORS
===================================================== */

/* Brand text colors */
.brand-fit {
  color: #4ade80; /* emerald green */
}

.brand-circuit {
  color: #f8fafc; /* near-white */
}

.brand-ai {
  color: #38bdf8; /* cyan / blue */
}

/* Optional: subtle brand glow (can remove if not needed) */
.brand-fit,
.brand-ai {
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.25);
}

/* =====================================================
   OUTLINED BLUE CTA (Preview / Secondary Action)
===================================================== */
.btn-outline-blue {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 1rem;
  border: 1px solid rgb(99 102 241);  
  color: rgb(129 140 248);    

  padding: 0.5rem 1rem;
  background-color: transparent;
  cursor: pointer;

  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.1s ease;
}

.btn-outline-blue:hover {
  background-color: rgba(99, 102, 241, 0.08); /* indigo-500/8 */
  color: #ffffff;
}

.btn-outline-blue:active {
  transform: scale(0.97);
}

@media (max-width: 640px) {
  #previewVideoContainer {
    padding-bottom: 3rem; 
  }
}

/* =====================================================
   SOFT CTA GLOW (NON-INTRUSIVE)
===================================================== */

.btn-glow {
  box-shadow:
    0 10px 28px rgba(79, 70, 229, 0.35),
    0 0 0 1px rgba(99, 102, 241, 0.35);
}

.btn-glow:hover {
  box-shadow:
    0 14px 36px rgba(79, 70, 229, 0.45),
    0 0 0 1px rgba(129, 140, 248, 0.45);
}

/* =====================================================
   MODAL ACTION BUTTON (LOGOUT / CONFIRM)
===================================================== */
.btn-modal {
  min-height: 3rem; /* matches your first button visually */
  padding-left: 1rem;
  padding-right: 1rem;
}

/* =====================================================
   OUTLINED NEUTRAL BUTTON (Utility / Secondary)
===================================================== */
.btn-outline-neutral {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 2.5rem; /* matches Restart button */

  padding: 0 1rem;

  border-radius: 1rem;
  border: 1px solid rgb(51 65 85); /* slate-700 */

  background-color: rgba(15, 23, 42, 0.6); /* slate-900/60 */
  color: rgb(203 213 225); /* slate-300 */

  font-size: 0.875rem; /* matches Restart */
  font-weight: 400;

  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.1s ease;
}

.btn-outline-neutral:hover {
  background-color: rgba(30, 41, 59, 0.85);
  border-color: rgb(71 85 105); /* slate-600 */
  color: #ffffff;
}

.btn-outline-neutral:active {
  transform: scale(0.97);
}


/* =====================================================
   OUTLINED SAFE BUTTON (Subscribe / Enable)
===================================================== */
.btn-outline-safe {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 1rem;
  border: 1px solid rgba(52, 211, 153, 0.55); /* emerald-400 */

  color: rgb(167 243 208); /* emerald-200 */

  background-color: transparent;

  /* inherits font-size: 1rem; font-weight: 400 from .btn */

  padding: 0.5rem 1rem;

  cursor: pointer;

  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.1s ease;
}

.btn-outline-safe:hover {
  background-color: rgba(52, 211, 153, 0.12);
  border-color: rgb(52 211 153);
  color: #ffffff;
}

.btn-outline-safe:active {
  transform: scale(0.97);
}

.btn-outline-safe:disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* -------------------------------------------------
   Glass surface used by text + right panel
-------------------------------------------------- */
.glass-panel {
  position: relative;
  background: linear-gradient(
    to bottom,
    rgba(10, 15, 30, 0.55),
    rgba(10, 15, 30, 0.35)
  );
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 1.75rem;
  padding: 2.25rem;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.02),
    0 20px 60px rgba(0, 0, 0, 0.4);
}

/* -------------------------------------------------
   Eye background container (RIGHT panel)
-------------------------------------------------- */
.eye-bg {
  background-size: 115%;
  background-position: 50% 55%;
  background-repeat: no-repeat;
  will-change: background-position;
  background-color: #020617;
}


/* -------------------------------------------------
   Optional eye vignette (keeps text readable)
-------------------------------------------------- */
.eye-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0.1),
    rgba(0, 0, 0, 0.45)
  );
  pointer-events: none;
}

/* =====================================================
   FULLSCREEN OVERLAY CONTROLS
===================================================== */

/* Vertical fullscreen meta labels (left side) */
#fsMetaCol {
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

/* Slightly tighter on mobile */
@media (max-width: 640px) {
  #fsMetaCol {
    font-size: 0.9rem;
  }
}

.fs-meta {
  display: grid;
  grid-template-columns: min-content min-content auto;
  grid-auto-flow: row;  
  row-gap: 0.2rem;
  column-gap: 0.25rem;

  font-size: 0.9rem;
  color: rgb(203 213 225);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

.fs-meta .label {
  text-align: left;
  opacity: 0.8;
  white-space: nowrap;
}

.fs-meta .colon {
  text-align: center;
  opacity: 0.6;
}

.fs-meta .value {
  text-align: left;
  font-weight: 500;
  white-space: nowrap;
}



/* Fullscreen top-bar buttons (music + exercise) */
.fs-btn {
  width: 3rem;
  height: 3rem;
  aspect-ratio: 1 / 1;

  padding: 0 !important; 
  border: 0;

  border-radius: 0.75rem;
  background: rgba(0, 0, 0, 0.5);

  display: inline-flex;
  align-items: center;
  justify-content: center;

  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  transition: background-color 0.15s ease, transform 0.1s ease;
}


.fs-btn:hover {
  background: rgb(79 70 229);
}

.fs-btn:active {
  transform: scale(0.96);
}

/* Base icon state */
.fs-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
  stroke: none;
}

/* Visibility is controlled ONLY by .hidden */
.fs-btn svg.hidden {
  display: none !important;
}

.fs-btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

/* Flip repeat icon (optional aesthetic) */
#fsMusicRepeat svg {
  transform: scaleX(-1);
}


.fs-music-hint::before {
  content: "♪♪";
  position: absolute;
  top: -12px;
  left: -8px;
  font-size: 1.1rem;
  opacity: 0.35;
}

.fs-workout-hint::before {
  content: "🏋️";
  position: absolute;
  top: -12px;
  right: -8px;
  font-size: 1.05rem;
  opacity: 0.35;
}

.icon-btn {
  width: 44px;
  height: 44px;
  padding: 0;
}

@media (max-width: 640px) {
  .btn-for-mobile {
    padding-top: 1.1rem;
    padding-bottom: 1.1rem;
  }
}


/* =====================================================
   Mobile landscape should look like mobile portrait
   (prevents iOS Safari "desktop-ish" shrink)
===================================================== */
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {

  /* Keep base text sizing consistent */
  html { font-size: 16px !important; }
  body { font-size: 1rem !important; }

  /* Buttons: force your mobile button sizing */
  .btn-for-mobile {
    font-size: 1.05rem !important;
    padding: 0.95rem 1.15rem !important;
    min-height: 52px !important;
    border-radius: 1rem !important;
  }

  /* If you have smaller secondary buttons */
  .btn-modal,
  .btn-pay,
  .home-cta {
    font-size: 1.05rem !important;
    padding: 0.95rem 1.15rem !important;
    min-height: 52px !important;
  }

  /* Icon buttons (hamburger, small round buttons, etc.) */
  .icon-btn {
    width: 48px !important;
    height: 48px !important;
  }
}

/* Make dropdown items (mobile + desktop) match the Account/nav-link typography */
#mobileMenu .mobile-link,
#accountMenu .mobile-link {
  font: inherit;          
  font-weight: 300;         
  letter-spacing: -0.01em;   
  font-size: 1rem;       
  line-height: 1.25rem;
}

/* Mobile: make menu font a bit larger */
@media (max-width: 767px) {
  #mobileMenu .mobile-link {
    font-size: 1.1rem; 
    line-height: 1.35rem;
  }
}

html, body {
  height: 100%;
  overscroll-behavior: none;
}


footer {
  height: 72px;
}

header {
  padding-top: env(safe-area-inset-top);
  background-clip: padding-box;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(255,255,255,0.15),
    transparent
  );
}


/* ================= Timer Container ================= */

.timer-safe {
  width: min(60vh, 70vmin, 520px);
  aspect-ratio: 1 / 1;

  display: flex;
  align-items: center;
  justify-content: center;
  font-size: min(22vmin, 14rem);
}

#fsTime {
  font-size: 1em;
  line-height: 1;
  transform: translateY(0.04em);
}

/* Desktop boost */
@media (min-width: 769px) {
  .timer-safe {
    font-size: min(26vmin, 14rem);
  }
}

/* iOS / mobile landscape: constrain ring by height */
@media (orientation: landscape) and (max-height: 520px) {
  .timer-safe {
    width: min(56vh, 420px);   
    font-size: min(20vh, 10rem); 
  }
}


/* =====================================================
   EXERCISE MODAL — MOBILE BACKDROP BLUR (MATCH LOGIN)
===================================================== */

@media (max-width: 768px) {
  #exerciseModal {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: rgba(2, 6, 23, 0.55);
  }
}

@media (min-width: 769px) {
  #exerciseModal {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background-color: rgba(0, 0, 0, 0.7);
  }
}


/* =====================================================
   MODAL LAYER (always above fixed header)
===================================================== */

/* Header stays high, but modals must always be higher */
header {
  z-index: 40;
}

/* Force all overlays above everything */
#exerciseModal,
#fullscreenModal,
#logoutModal,
#emailModal {
  z-index: 9999 !important;
}

/* Lock background scroll when modal is open */
html.modal-open,
body.modal-open {
  overflow: hidden;
  height: 100%;
}

html.modal-open main {
  overflow: hidden !important;
}

/* =====================================================
   FULLSCREEN MODAL (BASE)
===================================================== */

#fullscreenModal .fs-surface {
  width: 100vw;
  height: 100dvh; /* dynamic viewport for iOS */
  
  /* Safe-area protection (A2HS + iOS app) */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}


/* Ensure video fills padded safe-area on iOS (prevents bottom gap) */
#fullscreenModal #fsPreviewVideo {
  top: calc(-1 * env(safe-area-inset-top, 0px));
  bottom: calc(-1 * env(safe-area-inset-bottom, 0px));
  left: calc(-1 * env(safe-area-inset-left, 0px));
  right: calc(-1 * env(safe-area-inset-right, 0px));
  width: calc(100% + env(safe-area-inset-left, 0px) + env(safe-area-inset-right, 0px));
  height: calc(100% + env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px));
}

/* =====================================================
   FULLSCREEN API OVERRIDES (Android / Desktop)
===================================================== */

:fullscreen #fullscreenModal > div[role="dialog"],
:fullscreen .fs-surface {
  width: 100vw !important;
  height: 100vh !important;

  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

/* =====================================================
   AUTH MODALS — MOBILE GUTTER (MATCH iOS)
===================================================== */

@media (max-width: 768px) {

  /* Overlay stays centered */
  #logoutModal,
  #emailModal {
    align-items: center !important;
    justify-content: center !important;
  }

  /* Modal card */
  #logoutModal > div,
  #emailModal > div {
    width: calc(100vw - 32px);   
    max-width: none !important;

    margin: 0 auto !important;
    border-radius: 20px;

    /* Safe area support */
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
  }
}

/* =====================================================
   AUTH MODALS — DESKTOP WIDTH LOCK
   Prevents growth on large screens
===================================================== */

@media (min-width: 769px) {

  /* Logout modal */
  #logoutModal > div {
    width: 100%;
    max-width: 420px;   
    margin: 0 auto;
  }

  /* Email / login modal */
  #emailModal > div {
    width: 100%;
    max-width: 520px;  
    margin: 0 auto;
  }
}


@keyframes fade-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

.animate-fade-in {
  animation: fade-in 0.15s ease-out;
}


/* =====================================================
   GLOBAL FORM CONTROL SIZING (mobile-first + desktop-by-device)
   Applies to inputs/selects/textareas site-wide,
   while excluding range/checkbox/radio/file and wallet buttons.
===================================================== */

/* Mobile defaults */
:root {
  --fc-font: 1.125rem; 
  --fc-line: 1.75rem;
  --fc-h: 48px;
  --fc-py: 0.65rem;
  --fc-px: 0.85rem;
  --toast-top: calc(env(safe-area-inset-top, 0px) + 12px);
}

/* Text-like controls only */
input:not([type="file"]):not([type="range"]):not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  font-size: var(--fc-font);
  line-height: var(--fc-line);

  /* Consistent visual height across input + select */
  height: var(--fc-h);

  /* Normalize spacing even if Tailwind uses px-3/py-2 */
  padding: var(--fc-py) var(--fc-px);

  box-sizing: border-box;
}

/* Keep sliders as-is */
input[type="range"] {
  height: auto;
  padding: 0;
}

/* Desktop devices (Mac/PC) regardless of viewport width */
@media (hover: hover) and (pointer: fine) {
  :root {
    --fc-font: 0.95rem;  /* ~15px */
    --fc-line: 1.4rem;
    --fc-h: 44px;
    --fc-py: 0.55rem;
    --fc-px: 0.80rem;
  }

  /* Safari: select can still feel tighter */
  select {
    line-height: 1.6rem;
  }
}
