/* =========================================================================
   MFLIX — sistema de design
   Um arquivo só. Substitui app.css, pages.css e refresh.css, que se
   sobrepunham e brigavam entre si.
   ========================================================================= */

/* ------------------------------- Fundações ------------------------------- */

:root {
  /* Fundo em camadas: quanto mais alto o elemento, mais claro. */
  --bg:        #07090d;
  --bg-soft:   #0b0e14;
  --surface:   #11151d;
  --surface-2: #171d27;
  --surface-3: #202836;

  --line:   rgba(160, 180, 210, .11);
  --line-2: rgba(160, 180, 210, .20);

  --text:  #f2f5f9;
  --text-2:#c3ccd9;
  --muted: #8794a6;

  /* Vermelho é a cor do "ao vivo". Usado com parcimônia para não perder força. */
  --red:   #ff4326;
  --red-2: #ff6a4a;
  --red-dp:#c1210f;
  --grad-red: linear-gradient(135deg, #ff5b36, #e01f0c);
  --glow-red: 0 10px 40px -12px rgba(255, 67, 38, .65);

  --green: #34d17f;
  --amber: #ffb020;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --wrap: 1180px;
  --header-h: 68px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Sora', var(--font);

  --ease: cubic-bezier(.22, .61, .36, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Brilho difuso no topo: dá profundidade sem pesar em nada. */
body::before {
  content: '';
  position: fixed;
  inset: 0 0 auto 0;
  height: 70vh;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 50% at 78% -8%, rgba(255, 67, 38, .13), transparent 70%),
    radial-gradient(ellipse 50% 40% at 12% -4%, rgba(60, 110, 220, .10), transparent 70%);
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.15;
  margin: 0;
}

p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

button, input, select, textarea { font: inherit; color: inherit; }

/* 16px evita o zoom automático do iOS ao focar um campo. */
input, select, textarea { font-size: 16px; }

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

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

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2a3342; border-radius: 20px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #384254; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 22px;
  position: relative;
  z-index: 1;
}

.muted { color: var(--muted); }
.hidden { display: none !important; }
.right  { text-align: right; }
.mono   { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .92em; }

.section { padding: clamp(56px, 8vw, 96px) 0; }

/* --------------------------------- Botões -------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: none;
  font-size: 14.5px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .16s var(--ease), background .16s var(--ease),
              border-color .16s var(--ease), box-shadow .16s var(--ease);
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--grad-red);
  color: #fff;
  box-shadow: var(--glow-red);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 16px 46px -12px rgba(255, 67, 38, .8);
}

.btn-ghost {
  background: rgba(255, 255, 255, .045);
  border-color: var(--line-2);
  color: var(--text);
}
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .09); border-color: var(--line-2); }

.btn-soft { background: var(--surface-2); border-color: var(--line); color: var(--text-2); }
.btn-soft:hover:not(:disabled) { background: var(--surface-3); }

.btn-lg { min-height: 54px; padding: 0 30px; font-size: 16px; border-radius: 14px; }
.btn-sm { min-height: 38px; padding: 0 15px; font-size: 13px; border-radius: 10px; }
.btn-full { width: 100%; }

/* --------------------------------- Badges -------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, .04);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: .01em;
  color: var(--text-2);
}

.badge-ok   { border-color: rgba(52, 209, 127, .38); background: rgba(52, 209, 127, .12); color: var(--green); }
.badge-vip  { border-color: rgba(255, 176, 32, .38); background: rgba(255, 176, 32, .12); color: var(--amber); }
.badge-live { border-color: rgba(255, 67, 38, .42); background: rgba(255, 67, 38, .14); color: var(--red-2); }

.badge-live .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--red-2);
  box-shadow: 0 0 0 0 rgba(255, 67, 38, .7);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  70%  { box-shadow: 0 0 0 7px rgba(255, 67, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 67, 38, 0); }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--red-2);
}

/* --------------------------------- Cartões ------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 26px;
}

/* -------------------------------- Cabeçalho ------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(7, 9, 13, .82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 26px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -.04em;
  flex: none;
}
.brand b { color: var(--red-2); }

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--grad-red);
  color: #fff;
  box-shadow: var(--glow-red);
}

.nav { display: flex; align-items: center; gap: 4px; }

.nav a {
  padding: 8px 13px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--muted);
  transition: color .15s, background .15s;
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.nav a.active { color: var(--text); background: rgba(255, 255, 255, .08); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  cursor: pointer;
  place-items: center;
}

/* Menu da conta. Os nomes seguem o que o Layout do core.js gera. */
.user-menu { position: relative; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 5px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.user-chip:hover { background: rgba(255, 255, 255, .08); }
.user-chip-name { font-size: 13.5px; font-weight: 600; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--grad-red);
  color: #fff;
  font-size: 12px;
  font-weight: 750;
  flex: none;
}

.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 216px;
  padding: 7px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .85);
  display: none;
  z-index: 10;
}
.dropdown.open { display: block; }

.dropdown-head {
  padding: 10px 12px 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.dropdown-head strong { display: block; font-size: 13.5px; }
.dropdown-head span { font-size: 12px; color: var(--muted); word-break: break-all; }

.dropdown a, .dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  background: none;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  color: var(--text-2);
}
.dropdown a:hover, .dropdown button:hover { background: rgba(255, 255, 255, .07); color: var(--text); }
.dropdown .danger { color: #ff8f7a; }
.dropdown .danger:hover { background: rgba(255, 67, 38, .13); color: var(--red-2); }

@media (max-width: 760px) { .hide-mobile { display: none !important; } }

/* --------------------------------- Rodapé -------------------------------- */

.site-footer {
  margin-top: 90px;
  padding: 58px 0 30px;
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 40px;
}

.site-footer h5 {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.footer-links { display: grid; gap: 11px; }
.footer-links a { font-size: 14px; color: var(--text-2); transition: color .15s; }
.footer-links a:hover { color: var(--red-2); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}

/* ------------------------------ Cabeça de página -------------------------- */

.page-head { padding: 40px 0 30px; }
.page-head h1 { font-size: clamp(30px, 4vw, 42px); margin-bottom: 10px; }
.page-head p { color: var(--muted); font-size: 15.5px; }

/* --------------------------------- Formulários ---------------------------- */

.field { margin-bottom: 17px; }

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > svg:first-child { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.input-wrap > svg:first-child ~ .input { padding-left: 42px; }

.input {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s, background .15s;
}
.input::placeholder { color: #5d6a7c; }
.input:focus { outline: none; border-color: var(--red-2); background: var(--surface-2); }
.input.invalid { border-color: var(--red); }

.toggle-eye {
  position: absolute;
  right: 8px;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 0; border-radius: 9px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.toggle-eye:hover { color: var(--text); background: rgba(255, 255, 255, .06); }

.field-error { display: block; margin-top: 6px; font-size: 12.5px; color: var(--red-2); min-height: 16px; }

.form-alert {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 67, 38, .4);
  border-radius: 12px;
  background: rgba(255, 67, 38, .1);
  font-size: 13.5px;
  color: #ffb3a3;
}
.form-alert.show { display: flex; }
.form-alert.ok { border-color: rgba(52, 209, 127, .4); background: rgba(52, 209, 127, .1); color: #96e9bd; }

/* Força da senha */
.strength { display: flex; gap: 5px; margin-top: 9px; }
.strength::before, .strength::after,
.strength i { content: ''; height: 3px; flex: 1; border-radius: 2px; background: var(--surface-3); }
.strength.s1::before { background: var(--red); }
.strength.s2::before, .strength.s2::after { background: var(--amber); }
.strength.s3::before, .strength.s3::after, .strength.s3 i { background: var(--amber); }
.strength.s4::before, .strength.s4::after, .strength.s4 i { background: var(--green); }

.check-line { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--text-2); }
.check-line input { margin-top: 3px; accent-color: var(--red); width: 16px; height: 16px; }

/* --------------------------------- Toasts -------------------------------- */

#toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2000;
  display: grid;
  gap: 10px;
  max-width: min(360px, calc(100vw - 36px));
}

.toast {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  border: 1px solid var(--line-2);
  border-radius: 13px;
  background: var(--surface-2);
  box-shadow: 0 20px 50px -16px rgba(0, 0, 0, .9);
  font-size: 14px;
  animation: toast-in .28s var(--ease);
}
.toast.out { animation: toast-out .26s var(--ease) forwards; }
.toast .bar { width: 3px; align-self: stretch; border-radius: 3px; background: var(--muted); flex: none; }
.toast.success .bar { background: var(--green); }
.toast.error   .bar { background: var(--red); }
.toast.info    .bar { background: var(--amber); }

@keyframes toast-in  { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes toast-out { to   { opacity: 0; transform: translateY(8px) scale(.97); } }

/* -------------------------------- Esqueletos ------------------------------ */

.skeleton {
  border-radius: var(--r-md);
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.spinner {
  display: inline-block;
  width: 17px; height: 17px;
  border: 2px solid rgba(255, 255, 255, .18);
  border-top-color: var(--red-2);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-block { display: flex; align-items: center; justify-content: center; gap: 11px; padding: 40px; color: var(--muted); }

.empty-state {
  padding: 52px 24px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
  text-align: center;
}
.empty-state svg { color: var(--muted); margin-bottom: 14px; }
.empty-state h3 { font-size: 17px; margin-bottom: 7px; }
.empty-state p { font-size: 14px; color: var(--muted); }

/* -------------------------------- Responsivo ------------------------------ */

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 760px) {
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 14px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 22px 50px -20px rgba(0, 0, 0, .9);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 13px; font-size: 15px; }
  .nav-toggle { display: grid; }
  .site-header .wrap { gap: 12px; }
}

@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .page-head { padding: 26px 0 20px; }
  #toasts { right: 12px; left: 12px; bottom: 12px; max-width: none; }
}

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