/* FACILITY 360° · camada de experiência — login exclusivo e movimento (painel, app e entrega) */
:root { --fx-red: #c8233f; --fx-ease: cubic-bezier(.2, .7, .2, 1); --fx-ease-out: cubic-bezier(.16, 1, .3, 1); }
html.f360x-login, html.f360x-login body { background: #f4f5f7 !important; }
html.f360x-login.tema-escuro, html.f360x-login.tema-escuro body { background: #0c0d10 !important; }
.f360x-stage { position: fixed; z-index: 0; left: 0; top: 0; bottom: 0; width: 52vw; overflow: hidden; color: #fff;
  background: radial-gradient(120% 90% at 15% 10%, #2a1219 0%, rgba(42, 18, 25, 0) 55%), radial-gradient(90% 70% at 90% 100%, #1b1f27 0%, rgba(27, 31, 39, 0) 60%), linear-gradient(160deg, #15171c 0%, #0c0d10 100%);
  animation: f360x-fade .9s var(--fx-ease-out) both; }
.f360x-stage canvas { position: absolute; inset: 0; opacity: .95; }
.f360x-glow { position: absolute; width: 60vmax; height: 60vmax; left: -18vmax; top: -22vmax; border-radius: 50%; background: radial-gradient(closest-side, rgba(200, 35, 63, .28), rgba(200, 35, 63, 0)); filter: blur(10px); animation: f360x-breathe 9s ease-in-out infinite; pointer-events: none; }
.f360x-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(12, 13, 16, 0) 40%, rgba(12, 13, 16, .75) 100%); }
.f360x-copy { position: absolute; z-index: 2; left: clamp(32px, 5vw, 72px); right: clamp(32px, 5vw, 72px); bottom: clamp(72px, 12vh, 120px); max-width: 560px; }
.f360x-eyebrow { display: inline-flex; align-items: center; gap: 10px; font: 650 11.5px/1 var(--font, Inter, system-ui, sans-serif); letter-spacing: .22em; color: rgba(255, 255, 255, .72); margin-bottom: 22px; animation: f360x-up .9s .15s var(--fx-ease-out) both; }
.f360x-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fx-red); box-shadow: 0 0 0 4px rgba(200, 35, 63, .22), 0 0 18px rgba(200, 35, 63, .8); animation: f360x-ping 2.4s ease-out infinite; }
.f360x-copy h1 { margin: 0 0 18px; font: 700 clamp(30px, 3.3vw, 46px)/1.08 var(--font-d, var(--font, Inter, system-ui, sans-serif)); letter-spacing: -.035em; color: #fff; animation: f360x-up .9s .25s var(--fx-ease-out) both; }
.f360x-copy h1 em { font-style: normal; background: linear-gradient(90deg, #ff6b84, #e23655 60%, #ff8fa1); -webkit-background-clip: text; background-clip: text; color: transparent; }
.f360x-copy p { margin: 0 0 26px; font-size: 15.5px; line-height: 1.55; color: rgba(255, 255, 255, .66); max-width: 440px; animation: f360x-up .9s .35s var(--fx-ease-out) both; }
.f360x-pills { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; animation: f360x-up .9s .45s var(--fx-ease-out) both; }
.f360x-pills li { font-size: 12.5px; font-weight: 600; padding: 7px 12px; border-radius: 999px; color: rgba(255, 255, 255, .82); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .10); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.f360x-foot { position: absolute; z-index: 2; left: clamp(32px, 5vw, 72px); bottom: 28px; font-size: 12px; color: rgba(255, 255, 255, .42); letter-spacing: .02em; }
html.f360x-login .login-wrap { position: relative; z-index: 1; margin-left: 52vw; min-height: 100vh; display: flex !important; align-items: center; justify-content: center; padding: 40px clamp(20px, 4vw, 56px) !important; background: transparent !important; }
html.f360x-login form.login { width: min(400px, 100%) !important; max-width: 400px !important; padding: 40px 36px 32px !important; gap: 16px !important; border-radius: 22px !important;
  background: #fff !important; color: #12151b !important; border: 1px solid #e4e7ec !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 30px 60px -30px rgba(15, 23, 42, .28) !important;
  animation: f360x-card .8s .1s var(--fx-ease-out) both; }
html.f360x-login form.login img { height: 46px !important; width: auto !important; max-width: 220px; align-self: flex-start; margin: 0 0 6px !important; filter: none !important; }
html.f360x-login form.login .tag { align-self: flex-start; display: inline-flex !important; align-items: center; gap: 8px; height: 26px; padding: 0 11px !important; border-radius: 999px !important; font-size: 11px !important; font-weight: 700 !important; letter-spacing: .12em !important; color: #8c1c32 !important; background: #fbf2f4 !important; border: 1px solid #f2d8de !important; }
html.f360x-login form.login .tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #c8233f; }
html.f360x-login form.login .field-l, html.f360x-login form.login label { color: #474e5b !important; font-weight: 600 !important; font-size: 13px !important; }
html.f360x-login form.login .input { height: 48px !important; border-radius: 12px !important; background: #f8f9fb !important; color: #12151b !important; border: 1px solid #d9dee5 !important; font-size: 15px !important; transition: border-color .15s var(--fx-ease), box-shadow .15s var(--fx-ease), background-color .15s var(--fx-ease) !important; }
html.f360x-login form.login .input:hover { border-color: #c3cad4 !important; }
html.f360x-login form.login .input:focus { background: #fff !important; border-color: #8c1c32 !important; box-shadow: 0 0 0 4px rgba(140, 28, 50, .12) !important; outline: none !important; }
html.f360x-login form.login .pw-eye { color: #7a818d !important; }
html.f360x-login form.login .btn-primary { position: relative; overflow: hidden; height: 50px !important; border-radius: 12px !important; font-size: 15px !important; font-weight: 650 !important; letter-spacing: .01em; color: #fff !important; border: 0 !important;
  background: linear-gradient(180deg, #a3223c 0%, #84182d 100%) !important; box-shadow: 0 1px 2px rgba(80, 10, 24, .3), 0 12px 24px -12px rgba(140, 28, 50, .75), inset 0 1px 0 rgba(255, 255, 255, .16) !important;
  transition: transform .12s var(--fx-ease), box-shadow .2s var(--fx-ease), filter .2s var(--fx-ease) !important; margin-top: 4px; }
html.f360x-login form.login .btn-primary::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .22), rgba(255, 255, 255, 0)); transform: skewX(-18deg); transition: left .7s var(--fx-ease-out); }
html.f360x-login form.login .btn-primary:hover::after { left: 130%; }
html.f360x-login form.login .btn-primary:hover { filter: brightness(1.06); }
html.f360x-login form.login .btn-primary:active { transform: translateY(1px) scale(.995); }
html.f360x-login form.login .amb-voltar { color: #7a818d !important; text-decoration: none; font-weight: 500; }
html.f360x-login form.login .amb-voltar:hover { color: #8c1c32 !important; }
html.f360x-login form.login .errbox { border-radius: 12px !important; }
html.f360x-login form.login.f360x-shake { animation: f360x-shake .42s var(--fx-ease) both; }
html.f360x-login.tema-escuro form.login { background: #14161b !important; color: #eceef2 !important; border-color: #262a32 !important; box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 40px 80px -30px rgba(0, 0, 0, .9) !important; }
html.f360x-login.tema-escuro form.login .input { background: #1a1d23 !important; color: #eceef2 !important; border-color: #2c313a !important; }
html.f360x-login.tema-escuro form.login .input:focus { background: #1d2027 !important; border-color: #d23a55 !important; box-shadow: 0 0 0 4px rgba(210, 58, 85, .22) !important; }
html.f360x-login.tema-escuro form.login .field-l, html.f360x-login.tema-escuro form.login label { color: #b3b8c2 !important; }
html.f360x-login.tema-escuro form.login .tag { background: rgba(210, 58, 85, .12) !important; border-color: rgba(210, 58, 85, .3) !important; color: #ff8fa1 !important; }
@media (max-width: 960px) {
  .f360x-stage { position: absolute; width: 100%; height: 300px; bottom: auto; }
  .f360x-copy { bottom: auto; top: 54px; left: 24px; right: 24px; }
  .f360x-copy h1 { font-size: 26px; margin-bottom: 0; }
  .f360x-copy p, .f360x-pills, .f360x-foot { display: none; }
  .f360x-eyebrow { margin-bottom: 14px; }
  html.f360x-login .login-wrap { margin-left: 0; padding: 220px 16px 32px !important; align-items: flex-start; }
  html.f360x-login form.login { padding: 30px 22px 24px !important; border-radius: 20px !important; }
}
.f360x-enter { animation: f360x-page .42s var(--fx-ease-out) both; }
html.f360x .modal { animation: f360x-pop .26s var(--fx-ease-out) both; }
html.f360x .overlay { animation: f360x-fade .2s ease both; }
html.f360x .toast, html.f360x .toasts > * { animation: f360x-toast .38s var(--fx-ease-out) both; }
html.f360x .card, html.f360x .kpi { animation: f360x-rise .5s var(--fx-ease-out) both; }
html.f360x [class*="-bar"] > i, html.f360x [class*="-bar"] > span, html.f360x .progress > * { transition: width .9s var(--fx-ease-out); }
@keyframes f360x-fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes f360x-up { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: none } }
@keyframes f360x-card { from { opacity: 0; transform: translateY(18px) scale(.985) } to { opacity: 1; transform: none } }
@keyframes f360x-page { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
@keyframes f360x-rise { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }
@keyframes f360x-pop { from { opacity: 0; transform: translateY(10px) scale(.98) } to { opacity: 1; transform: none } }
@keyframes f360x-toast { from { opacity: 0; transform: translateY(12px) scale(.97) } to { opacity: 1; transform: none } }
@keyframes f360x-breathe { 0%, 100% { transform: scale(1); opacity: .85 } 50% { transform: scale(1.08); opacity: 1 } }
@keyframes f360x-ping { 0% { box-shadow: 0 0 0 0 rgba(200, 35, 63, .55), 0 0 18px rgba(200, 35, 63, .8) } 80%, 100% { box-shadow: 0 0 0 12px rgba(200, 35, 63, 0), 0 0 18px rgba(200, 35, 63, .8) } }
@keyframes f360x-shake { 0%, 100% { transform: none } 20% { transform: translateX(-7px) } 40% { transform: translateX(6px) } 60% { transform: translateX(-4px) } 80% { transform: translateX(2px) } }
@media (prefers-reduced-motion: reduce) { .f360x-stage, .f360x-stage *, html.f360x *, html.f360x *::before, html.f360x *::after { animation: none !important; transition-duration: .01ms !important; } }

/* ---------- PÁGINA INICIAL (seleção de ambiente) ---------- */
html.f360x-idx, html.f360x-idx body { background: #0c0d10 !important; }
html.f360x-idx .f360x-stage { position: fixed !important; width: 100vw !important; height: 100vh !important; bottom: 0 !important; }
html.f360x-idx .f360x-copy, html.f360x-idx .f360x-foot { display: none; }
html.f360x-idx main { position: relative; z-index: 1; animation: f360x-up .8s var(--fx-ease-out) both; }
html.f360x-idx main .card { background: rgba(255, 255, 255, .045) !important; border: 1px solid rgba(255, 255, 255, .10) !important; -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  transition: transform .25s var(--fx-ease-out), border-color .25s var(--fx-ease), background-color .25s var(--fx-ease), box-shadow .25s var(--fx-ease) !important; }
html.f360x-idx main .card:hover { transform: translateY(-4px); border-color: rgba(232, 74, 100, .55) !important; background: rgba(255, 255, 255, .07) !important; box-shadow: 0 24px 50px -24px rgba(200, 35, 63, .55) !important; }
html.f360x-idx main .card:nth-child(1) { animation: f360x-up .7s .10s var(--fx-ease-out) both; }
html.f360x-idx main .card:nth-child(2) { animation: f360x-up .7s .18s var(--fx-ease-out) both; }
html.f360x-idx main .card:nth-child(3) { animation: f360x-up .7s .26s var(--fx-ease-out) both; }
html.f360x-idx main .card:nth-child(4) { animation: f360x-up .7s .34s var(--fx-ease-out) both; }
html.f360x-idx main .card:nth-child(5) { animation: f360x-up .7s .42s var(--fx-ease-out) both; }
/* ---------- CARREGAMENTO: esqueleto com brilho ---------- */
html.f360x .loading { position: relative; display: flex !important; flex-direction: column; align-items: stretch !important; gap: 12px; padding: 18px 4px !important; color: transparent !important; font-size: 0 !important; min-height: 120px; }
html.f360x .loading .spin { display: none !important; }
html.f360x .loading::before, html.f360x .loading::after { content: ""; display: block; border-radius: 12px; background: linear-gradient(90deg, var(--surface-3, #eef0f3) 0%, var(--surface-2, #f7f8fa) 40%, var(--surface-3, #eef0f3) 80%); background-size: 200% 100%; animation: f360x-shimmer 1.3s linear infinite; }
html.f360x .loading::before { height: 64px; }
html.f360x .loading::after { height: 140px; opacity: .8; }
html.tema-escuro.f360x .loading::before, html.tema-escuro.f360x .loading::after { background: linear-gradient(90deg, #17191e 0%, #20232a 40%, #17191e 80%); background-size: 200% 100%; }
html.f360x .btn .spin, html.f360x button .spin { display: inline-block !important; }
@keyframes f360x-shimmer { from { background-position: 200% 0 } to { background-position: -200% 0 } }
/* ---------- GRÁFICOS ---------- */
html.f360x .ve-bar > i, html.f360x .hbar > i, html.f360x .progress > span { transform-origin: left center; animation: f360x-grow-x .9s var(--fx-ease-out) both; }
html.f360x .ve-spark > i, html.f360x .day-bars i { transform-origin: bottom center; animation: f360x-grow-y .8s var(--fx-ease-out) both; transition: filter .15s var(--fx-ease), transform .15s var(--fx-ease); }
html.f360x .ve-spark > i:nth-child(3n) { animation-delay: .04s; } html.f360x .ve-spark > i:nth-child(3n+1) { animation-delay: .08s; }
html.f360x .ve-spark > i.f360x-tipped:hover, html.f360x .day-bars .f360x-tipped:hover { filter: brightness(1.25) saturate(1.1); transform: scaleY(1.04); }
.f360x-tip { position: fixed; z-index: 99999; pointer-events: none; padding: 7px 10px; border-radius: 9px; font: 600 12.5px/1.2 var(--font, Inter, system-ui, sans-serif); color: #fff; background: rgba(18, 21, 27, .94); box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .45); opacity: 0; transform: translateY(4px); transition: opacity .12s ease, transform .12s ease; white-space: nowrap; font-variant-numeric: tabular-nums; }
.f360x-tip.on { opacity: 1; transform: none; }
html.tema-escuro .f360x-tip { background: rgba(236, 238, 242, .96); color: #12151b; }
@keyframes f360x-grow-x { from { transform: scaleX(0) } to { transform: none } }
@keyframes f360x-grow-y { from { transform: scaleY(0) } to { transform: none } }
/* ---------- MAPAS ---------- */
.leaflet-popup-content-wrapper { border-radius: 14px !important; box-shadow: 0 18px 40px -16px rgba(15, 23, 42, .35) !important; }
.leaflet-popup-content { font-family: var(--font, Inter, system-ui, sans-serif); }
.leaflet-container .leaflet-control-zoom { border: 0 !important; box-shadow: 0 6px 18px -8px rgba(15, 23, 42, .3) !important; border-radius: 11px !important; overflow: hidden; }
html.tema-escuro .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.7); }
html.tema-escuro .leaflet-popup-content-wrapper, html.tema-escuro .leaflet-popup-tip { background: #1a1d23 !important; color: #eceef2 !important; }
html.tema-escuro .leaflet-container { background: #111318 !important; }
/* ---------- APP (cobrador · vendedor · motorista) ---------- */
html.f360x-app .app-top { background: radial-gradient(120% 140% at 100% 0%, rgba(200, 35, 63, .22) 0%, rgba(200, 35, 63, 0) 55%), linear-gradient(160deg, #1a1c22 0%, #0f1115 100%) !important; box-shadow: 0 18px 40px -24px rgba(15, 23, 42, .7) !important; }
html.f360x-app .app-top .hello { letter-spacing: -.025em; }
html.f360x-app .f360x-tema { color: #fff !important; }
html.f360x-app .sum-card { position: relative; overflow: hidden; background: linear-gradient(150deg, #a3223c 0%, #84182d 55%, #6c1325 100%) !important; box-shadow: 0 1px 2px rgba(80, 10, 24, .25), 0 24px 44px -24px rgba(140, 28, 50, .85) !important; border: 0 !important; }
html.f360x-app .sum-card::after { content: ""; position: absolute; inset: -40% -20% auto auto; width: 70%; height: 140%; background: radial-gradient(closest-side, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0)); pointer-events: none; }
html.f360x-app .sum-card .sum-grid > * { background: rgba(255, 255, 255, .10) !important; border: 1px solid rgba(255, 255, 255, .12) !important; }
html.f360x-app .sum-card .progress { background: rgba(255, 255, 255, .18) !important; }
html.f360x-app .sum-card .progress > span { background: #fff !important; box-shadow: 0 0 12px rgba(255, 255, 255, .6); }
html.f360x-app .tabbar { background: color-mix(in srgb, var(--surface, #fff) 82%, transparent) !important; -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); border: 1px solid var(--line, #e4e7ec) !important; box-shadow: 0 16px 40px -18px rgba(15, 23, 42, .35) !important; }
html.f360x-app .tabbar a, html.f360x-app .tabbar button { transition: color .15s var(--fx-ease), background-color .15s var(--fx-ease), transform .1s var(--fx-ease); }
html.f360x-app .tabbar a:active, html.f360x-app .tabbar button:active { transform: scale(.94); }
html.f360x-app .card, html.f360x-app .client-card, html.f360x-app .route-card { border-radius: 18px !important; border-color: var(--line, #e4e7ec) !important; box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -16px rgba(15, 23, 42, .18) !important; }
html.f360x-app .esp-row { transition: background-color .12s var(--fx-ease), transform .1s var(--fx-ease); }
html.f360x-app .esp-row:active { transform: scale(.985); }
html.f360x-app .btn-primary { background: linear-gradient(180deg, #a3223c 0%, #84182d 100%) !important; box-shadow: 0 1px 2px rgba(80, 10, 24, .25), 0 10px 22px -12px rgba(140, 28, 50, .8), inset 0 1px 0 rgba(255, 255, 255, .14) !important; border: 0 !important; }
html.f360x-app .btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }
html.tema-escuro.f360x-app { color-scheme: dark;
  --red: #d23a55; --red-700: #b72c46; --red-50: rgba(210, 58, 85, .13); --red-100: rgba(210, 58, 85, .26);
  --ink: #eceef2; --ink-2: #b3b8c2; --muted: #808693; --line: #262a32; --line-2: #1e2128;
  --bg: #0c0d10; --surface: #14161b; --surface-2: #1a1d23; --surface-3: #20232a;
  --good: #4fc68d; --good-bg: rgba(79, 198, 141, .12); --warn: #e9ad45; --warn-bg: rgba(233, 173, 69, .12);
  --bad: #f2676f; --bad-bg: rgba(242, 103, 111, .12); --info: #72aced; --info-bg: rgba(114, 172, 237, .12); }
html.tema-escuro.f360x-app, html.tema-escuro.f360x-app body { background: #0c0d10 !important; color: #eceef2; }
html.tema-escuro.f360x-app .app-top { background: radial-gradient(120% 140% at 100% 0%, rgba(210, 58, 85, .18) 0%, rgba(210, 58, 85, 0) 55%), linear-gradient(160deg, #15171c 0%, #0c0d10 100%) !important; box-shadow: 0 1px 0 #262a32 !important; }
html.tema-escuro.f360x-app .f360x-dk-bg { background-color: #1a1d23 !important; }
html.tema-escuro.f360x-app .f360x-dk-bd { border-color: #2c313a !important; }
html.tema-escuro.f360x-app .f360x-dk-tx { color: #eceef2 !important; }
html.tema-escuro.f360x-app input, html.tema-escuro.f360x-app select, html.tema-escuro.f360x-app textarea { color-scheme: dark; }

/* app no tema claro: mesmos tokens frios do painel */
html.f360x-app:not(.tema-escuro) { --ink: #12151b; --ink-2: #474e5b; --muted: #7a818d; --line: #e4e7ec; --line-2: #eff1f4; --bg: #f5f6f8; --surface: #ffffff; --surface-2: #f8f9fb; --surface-3: #f1f3f6; --red: #8c1c32; --red-700: #721427; --red-50: #fbf2f4; --red-100: #f2d8de; }
html.f360x-app:not(.tema-escuro), html.f360x-app:not(.tema-escuro) body { background: #f5f6f8; }
/* a logomarca mantém sempre a placa branca original */
html.tema-escuro .app-top img, html.tema-escuro .side .brand img { background: #fff !important; }

/* v18: animações de entrada não deixam "transform" preso nos elementos depois de terminar
   (no iPhone isso fazia janelas e o carrinho ficarem cortados ou presos) */
html.f360x .f360x-enter, html.f360x .card, html.f360x .kpi, html.f360x .modal, html.f360x .overlay, .f360x-enter { animation-fill-mode: backwards !important; }
