/* ============================================================
   Legendários — base visual compartilhada (público + admin)
   ============================================================ */
:root {
  --brand: #fb4506;
  --brand-2: #ff7a1a;
  --brand-3: #ffb347;
  --brand-deep: #c23400;
  --brand-glow: rgba(251, 69, 6, .45);

  --bg: #09090b;
  --bg-2: #111114;
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .08);
  --surface-solid: #16161a;
  --border: rgba(255, 255, 255, .09);
  --border-strong: rgba(255, 255, 255, .16);

  --text: #f6f3f1;
  --text-2: #b9b2ad;
  --text-3: #7d7672;

  --ok: #22c55e;
  --warn: #facc15;
  --danger: #ef4444;
  --info: #38bdf8;

  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, .7);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Montserrat", var(--font);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--brand-2); }

::selection { background: var(--brand); color: #fff; }

.icon { width: 1.25em; height: 1.25em; flex: none; display: inline-block; vertical-align: middle; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 3px; border-radius: 8px; }

/* ---------------- fundo animado ---------------- */
.bg-fx { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }

.bg-fx::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(251, 69, 6, .18), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

.bg-fx .blob {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55;
  animation: float 18s var(--ease) infinite alternate;
}
.bg-fx .b1 { width: 420px; height: 420px; background: var(--brand); top: -140px; left: -120px; }
.bg-fx .b2 { width: 360px; height: 360px; background: var(--brand-deep); bottom: -120px; right: -100px; animation-delay: -6s; opacity: .45; }
.bg-fx .b3 { width: 260px; height: 260px; background: var(--brand-3); top: 45%; left: 60%; animation-delay: -12s; opacity: .18; }

/* textura de ruído + grade topográfica sutil */
.bg-fx::after {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.1); }
  100% { transform: translate(-30px, 80px) scale(.95); }
}

/* ---------------- par de logos (logo + logo-1) ---------------- */
.logos { display: flex; align-items: center; justify-content: center; gap: 18px; }
.logos .sep { width: 1px; align-self: stretch; margin: 8px 0; background: linear-gradient(transparent, var(--border-strong), transparent); }
.logos .logo-2 { width: auto; height: auto; max-width: 150px; max-height: 100px; object-fit: contain; animation: logoIn 1s .15s var(--spring) both; }
.logos.solo .sep { display: none; }
@keyframes logoIn { from { opacity: 0; transform: scale(.6) rotate(-8deg); } }

/* ---------------- tipografia ---------------- */
.display {
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  letter-spacing: -.02em;
  line-height: 1.02;
  text-transform: uppercase;
}

.grad-text {
  background: linear-gradient(100deg, #fff 0%, var(--brand-3) 45%, var(--brand) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------------- superfícies ---------------- */
.glass {
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.025));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.06);
}

/* ---------------- botões ---------------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  height: 52px; padding: 0 1.4rem; border-radius: 16px;
  font-weight: 700; letter-spacing: .01em; white-space: nowrap;
  transition: transform .25s var(--spring), box-shadow .25s var(--ease), background .2s, opacity .2s;
  overflow: hidden; user-select: none;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-2) 0%, var(--brand) 55%, var(--brand-deep) 100%);
  box-shadow: 0 10px 30px -8px var(--brand-glow), inset 0 1px 0 rgba(255,255,255,.3);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 16px 40px -8px var(--brand-glow), inset 0 1px 0 rgba(255,255,255,.3); transform: translateY(-1px); }
.btn-primary::after {
  content: ""; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
  background: linear-gradient(110deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg);
  animation: shine 3.8s ease-in-out infinite;
}
@keyframes shine { 0%, 60% { left: -120%; } 100% { left: 160%; } }

.btn-ghost { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-strong); }

.btn-danger { background: rgba(239, 68, 68, .12); color: #fca5a5; border: 1px solid rgba(239, 68, 68, .3); }
.btn-danger:hover:not(:disabled) { background: rgba(239, 68, 68, .2); }

.btn-block { width: 100%; }
.btn-sm { height: 40px; padding: 0 1rem; border-radius: 12px; font-size: .9rem; }

.btn-icon {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  color: var(--text-2); background: var(--surface); border: 1px solid var(--border);
  transition: all .2s var(--ease);
}
.btn-icon:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-strong); }
.btn-icon:active { transform: scale(.9); }

.btn .spinner { display: none; }
.btn.loading .spinner { display: block; }
.btn.loading .btn-label, .btn.loading .btn-ico { display: none; }

.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.3); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- campos ---------------- */
.field { position: relative; display: block; }

.input, .textarea {
  width: 100%; border-radius: 16px;
  background: rgba(0,0,0,.35); border: 1.5px solid var(--border);
  color: var(--text); outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.input { height: 54px; padding: 0 1rem 0 3rem; }
.textarea { padding: 1.1rem 1.15rem; resize: none; line-height: 1.55; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .textarea:focus {
  border-color: var(--brand); background: rgba(0,0,0,.5);
  box-shadow: 0 0 0 4px rgba(251, 69, 6, .15);
}
.field > .icon.lead {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none; transition: color .2s;
}
.field:focus-within > .icon.lead { color: var(--brand-2); }

/* ---------------- toast ---------------- */
.toasts {
  position: fixed; left: 50%; transform: translateX(-50%);
  top: calc(16px + var(--safe-top)); z-index: 999;
  display: flex; flex-direction: column; gap: 10px; align-items: center;
  width: min(92vw, 420px); pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: .7rem; width: 100%;
  padding: .85rem 1rem; border-radius: 16px;
  background: rgba(22, 22, 26, .92); border: 1px solid var(--border-strong);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow); font-size: .95rem; font-weight: 500;
  animation: toastIn .45s var(--spring) both; pointer-events: auto;
}
.toast.out { animation: toastOut .3s var(--ease) both; }
.toast .t-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; flex: none; }
.toast.ok .t-ico { background: rgba(34,197,94,.15); color: var(--ok); }
.toast.err .t-ico { background: rgba(239,68,68,.15); color: var(--danger); }
.toast.info .t-ico { background: rgba(251,69,6,.15); color: var(--brand-2); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-20px) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-14px) scale(.95); } }

/* ---------------- utilitários de animação ---------------- */
.reveal { animation: reveal .8s var(--ease) both; }
.d1 { animation-delay: .08s; } .d2 { animation-delay: .16s; } .d3 { animation-delay: .24s; } .d4 { animation-delay: .32s; } .d5 { animation-delay: .4s; }
@keyframes reveal { from { opacity: 0; transform: translateY(24px); filter: blur(6px); } }

.shake { animation: shake .5s var(--ease); }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}

.pulse-dot { position: relative; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); flex: none; }
.pulse-dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit;
  animation: ping 1.6s cubic-bezier(0, 0, .2, 1) infinite;
}
.pulse-dot.off { background: var(--text-3); }
.pulse-dot.off::after { display: none; }
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }

/* confete */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 998; overflow: hidden; }
.confetti i {
  position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px;
  animation: fall linear forwards;
}
@keyframes fall { to { transform: translate3d(var(--dx), 110vh, 0) rotate(var(--rot)); opacity: .9; } }

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