/* Befit — styles consumed by the shortcode container and by the auth card.
 * IMPORTANT: every Befit colour token is locked here, NOT inherited from the
 * host theme. Plenty of WP themes set --accent / --ink globally, which would
 * bleed into the app otherwise (we saw a theme push everything to pink). */

.befit-host {
  /* Theme tokens (re-declared so the host theme can't override them).
   * 0.13.0: default accent is yellow. The bootstrap overrides these at boot
   * with whatever the admin picked in Configurações → Befit. */
  --accent: #FFD400;
  --accent-ink: #1a1500;
  --ink: #F3F6EF;
  --ink-dim: rgba(243,246,239,0.58);
  --ink-faint: rgba(243,246,239,0.34);
  --surface: rgba(255,255,255,0.05);
  --surface-2: rgba(255,255,255,0.085);
  --hair: rgba(255,255,255,0.09);
  --font-display: 'Space Grotesk', 'Outfit', system-ui, -apple-system, sans-serif;
  --screen-bg:
    radial-gradient(120% 80% at 80% -5%, rgba(255,212,0,0.08) 0%, transparent 45%),
    radial-gradient(90% 60% at 0% 100%, rgba(255,255,255,0.03) 0%, transparent 50%),
    linear-gradient(180deg, #0c0e0c 0%, #08090a 60%, #060706 100%);

  background:
    radial-gradient(80% 60% at 50% 0%, #1a1c1a 0%, #0b0c0b 45%, #060606 100%);
  color: var(--ink);
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  /* 0.12.1: kill any horizontal scroll caused by negative-margin scroll strips
   * (week strip, etc.) bleeding past the viewport edge on narrow phones. */
  overflow-x: hidden;
}

/* Also block horizontal scroll on the document itself when the Befit page is
 * the active route — themes that don't set overflow-x can let a 1px overflow
 * leak through. */
html:has(.befit-host),
body:has(.befit-host) {
  overflow-x: hidden;
  max-width: 100%;
}

/* Re-assert tokens on every descendant so even an Elementor / theme block
 * that re-declares a var at a deeper selector loses to ours. */
.befit-host * {
  -webkit-tap-highlight-color: transparent;
}

/* Some WP themes inject heading colours/weights via .entry-content h1/h2; the
 * shortcode lives inside .entry-content on most page templates. Reset that. */
.befit-host h1, .befit-host h2, .befit-host h3 {
  color: inherit;
  font-weight: inherit;
  margin: 0;
}

/* Pulse animation used by the StatusPill component. The prototype declared
 * this in the index.html <style> block; bring it along here. */
@keyframes bfPulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }
.befit-host .bf-pulse { animation: bfPulse 1.4s ease-in-out infinite; }

/* Hide scrollbars on the inner scroll area. */
.befit-host .bf-screen::-webkit-scrollbar { width: 0; height: 0; }
.befit-host .bf-screen { scrollbar-width: none; }

/* iOS Safari focus-zoom fix (0.14.1).
 * Any <input>/<textarea>/<select> with computed font-size below 16px makes
 * iOS Safari auto-zoom on focus (and never zooms back), wrecking the layout.
 * Force the minimum on mobile widths — visible size is the same because we
 * scale via CSS transform on the form's wrapper rather than the input itself
 * where we want compact UI (we kept the wrappers at their original visual
 * size). */
@media (max-width: 640px) {
  .befit-host input,
  .befit-host textarea,
  .befit-host select {
    font-size: 16px !important;
  }
}

.befit-boot {
  align-self: center;
  margin: auto;
  font-size: 14px;
  color: rgba(243, 246, 239, 0.5);
  letter-spacing: 0.2px;
}

/* ── Auth card ─────────────────────────────────────────────────────── */

.befit-auth-host {
  padding: 60px 20px;
  align-items: center;
  justify-content: center;
}

.befit-auth-card {
  width: 100%;
  max-width: 380px;
  padding: 32px 28px 28px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.befit-auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 24px;
}

.befit-bolt {
  display: inline-block;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--accent);
  box-shadow: 0 0 18px color-mix(in oklab, var(--accent) 50%, transparent);
  position: relative;
}
.befit-bolt::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230c0d0b' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'><path d='M13 3 5 13h6l-1 8 8-10h-6z'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 60% 60%;
}

.befit-wordmark {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.3px;
  color: #F3F6EF;
}
.befit-wordmark .accent { color: var(--accent); }

.befit-host .befit-auth-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  margin-bottom: 20px;
}

/* Auth controls — every selector is prefixed with .befit-host AND uses
 * !important on colours/sizing so a host theme's button/input rules can't
 * win (we saw a theme push the submit button to pink). */
.befit-host .befit-auth-tab {
  flex: 1 !important;
  height: 36px !important;
  border-radius: 10px !important;
  border: none !important;
  background: transparent !important;
  color: rgba(243, 246, 239, 0.58) !important;
  font: inherit !important;
  font-weight: 600 !important;
  font-size: 13.5px !important;
  cursor: pointer !important;
  transition: background .18s ease, color .18s ease;
  text-transform: none !important;
  letter-spacing: 0 !important;
  box-shadow: none !important;
}
.befit-host .befit-auth-tab:disabled { opacity: 0.4 !important; cursor: not-allowed !important; }
.befit-host .befit-auth-tab.is-active {
  background: rgba(255, 255, 255, 0.07) !important;
  color: #F3F6EF !important;
}

.befit-host .befit-auth-form {
  display: none;
  flex-direction: column;
  gap: 13px;
}
.befit-host .befit-auth-form.is-active { display: flex; }

.befit-host .befit-auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: rgba(243, 246, 239, 0.65) !important;
  text-transform: uppercase;
}

.befit-host .befit-auth-form input {
  height: 44px !important;
  padding: 0 13px !important;
  border-radius: 11px !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  background: rgba(0, 0, 0, 0.28) !important;
  color: #F3F6EF !important;
  font: inherit !important;
  font-size: 14.5px !important;
  outline: none !important;
  box-shadow: none !important;
  transition: border-color .15s, background .15s;
}
.befit-host .befit-auth-form input:focus {
  border-color: var(--accent) !important;
  background: rgba(0, 0, 0, 0.38) !important;
}

.befit-host .befit-auth-submit {
  margin-top: 6px !important;
  height: 48px !important;
  border-radius: 13px !important;
  border: none !important;
  background: var(--accent) !important;
  color: var(--accent-ink) !important;
  font: inherit !important;
  font-weight: 700 !important;
  font-size: 15px !important;
  letter-spacing: 0.1px !important;
  text-transform: none !important;
  cursor: pointer !important;
  box-shadow: 0 10px 24px color-mix(in oklab, var(--accent) 28%, transparent) !important;
  transition: transform .12s ease;
}
.befit-host .befit-auth-submit:hover { transform: translateY(-1px); background: var(--accent) !important; }
.befit-host .befit-auth-submit:disabled {
  opacity: 0.7 !important;
  cursor: progress !important;
  transform: none !important;
}

.befit-auth-msg {
  margin: 4px 0 0;
  min-height: 18px;
  font-size: 13px;
  color: #FF7A59;
  font-weight: 500;
}
.befit-auth-msg.is-ok { color: var(--accent); }

.befit-auth-disabled {
  margin: 0;
  font-size: 12px;
  color: rgba(243, 246, 239, 0.45);
}
