/* =========================================================================
   MFLIX — design system (preto & vermelho)
   ========================================================================= */

:root {
  --bg: #08080a;
  --bg-2: #0b0b0e;
  --surface: #121216;
  --surface-2: #17171d;
  --surface-3: #1e1e25;

  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);

  --text: #f4f4f6;
  --text-2: #c9c9d2;
  --muted: #8b8b98;

  --red: #e10600;
  --red-2: #ff2d20;
  --red-3: #8f0000;
  --grad-red: linear-gradient(135deg, #ff2d20 0%, #c40008 100%);
  --glow: 0 0 0 1px rgba(255, 45, 32, .35), 0 18px 45px -18px rgba(225, 6, 0, .75);

  --green: #22c55e;
  --amber: #f5a524;

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

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 20px 50px -25px rgba(0, 0, 0, .9);

  --wrap: 1240px;
  --header-h: 72px;

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

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

p { margin: 0; }

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

/* Ícones não devem carregar o espaço extra da linha de texto. */
.ic svg, .tick svg, .brand-mark svg, .pbtn svg, .avatar svg { display: block; }

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

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

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 clamp(16px, 3%, 28px);
}

/* Telas grandes: o conteúdo acompanha, em vez de virar uma coluna estreita. */
@media (min-width: 1560px) {
  :root { --wrap: 1400px; --header-h: 78px; }
  body { font-size: 15.5px; }
}

@media (min-width: 1900px) {
  :root { --wrap: 1520px; }
}

.muted { color: var(--muted); }
.center { text-align: center; }
.hidden { display: none !important; }

/* ------------------------------- Tipografia ------------------------------ */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-2);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  padding: 7px 14px;
  border-radius: 999px;
}

.eyebrow svg { color: var(--red-2); }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.section-head h2 { font-size: clamp(26px, 3.4vw, 38px); }
.section-head p { color: var(--muted); margin-top: 8px; max-width: 52ch; }

.grad-text {
  background: linear-gradient(120deg, #fff 20%, var(--red-2) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 46px;
  padding: 0 22px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .16s ease, filter .16s ease, background .16s ease, border-color .16s ease;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); border-color: var(--line-2); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--grad-red);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 12px 30px -14px rgba(225, 6, 0, .9);
}
.btn-primary:hover { filter: brightness(1.08); }

.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { background: rgba(255, 255, 255, .05); }

.btn-soft { background: rgba(255, 45, 32, .12); border-color: rgba(255, 45, 32, .3); color: #ff6b5e; }
.btn-soft:hover { background: rgba(255, 45, 32, .18); }

.btn-lg { height: 54px; padding: 0 28px; font-size: 15px; border-radius: var(--r-md); }
.btn-sm { height: 38px; padding: 0 16px; font-size: 13px; border-radius: 10px; }
.btn-full { width: 100%; }
.btn-icon { width: 42px; padding: 0; }

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .05);
  color: var(--text-2);
}

.badge-live { background: rgba(225, 6, 0, .16); border-color: rgba(255, 45, 32, .4); color: #ff6b5e; }
.badge-live .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red-2);
  box-shadow: 0 0 0 0 rgba(255, 45, 32, .7);
  animation: pulse-dot 1.6s infinite;
}
.badge-vip { background: rgba(245, 165, 36, .14); border-color: rgba(245, 165, 36, .35); color: var(--amber); }
.badge-ok { background: rgba(34, 197, 94, .14); border-color: rgba(34, 197, 94, .35); color: var(--green); }

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(255, 45, 32, .7); }
  70% { box-shadow: 0 0 0 7px rgba(255, 45, 32, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 45, 32, 0); }
}

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

.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-2);
}

.card-hover { transition: border-color .18s ease, transform .18s ease; }
.card-hover:hover { border-color: rgba(255, 45, 32, .45); transform: translateY(-3px); }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  background: rgba(8, 8, 10, 0);
  transition: background .25s ease, border-color .25s ease, backdrop-filter .25s ease;
}

.site-header.solid {
  background: rgba(8, 8, 10, .82);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -.03em;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--grad-red);
  box-shadow: 0 8px 22px -10px rgba(225, 6, 0, .9);
  color: #fff;
  flex-shrink: 0;
}

.brand span b { color: var(--red-2); }

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

.nav a {
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: color .15s ease, background .15s ease;
}

.nav a:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.nav a.active { color: var(--text); background: rgba(255, 255, 255, .07); }
.nav .only-mobile { display: none; }

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

.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  align-items: center; justify-content: center;
  cursor: pointer;
}

/* menu do usuário */
.user-menu { position: relative; }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 12px 0 6px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  cursor: pointer;
}
.user-chip:hover { border-color: var(--line-2); }

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad-red);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.user-chip-name { font-size: 14px; font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 240px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 8px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .95);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all .18s ease;
}
.dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }

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

.dropdown a, .dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  background: none;
  border: 0;
  text-align: left;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
}
.dropdown a:hover, .dropdown button:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.dropdown .danger:hover { color: #ff6b5e; background: rgba(225, 6, 0, .12); }

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

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  padding: 54px 0 34px;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-grid h5 {
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
  font-weight: 700;
}

.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { color: var(--text-2); font-size: 14px; }
.footer-links a:hover { color: var(--red-2); }

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

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

.field { margin-bottom: 16px; }

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

.input-wrap { position: relative; display: flex; align-items: center; }

.input-wrap > svg {
  position: absolute;
  left: 14px;
  color: var(--muted);
  pointer-events: none;
}

.input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border-radius: var(--r-md);
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  color: var(--text);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.input-wrap > svg + .input { padding-left: 44px; }

.input::placeholder { color: #5f5f6c; }
.input:focus {
  border-color: rgba(255, 45, 32, .65);
  box-shadow: 0 0 0 4px rgba(225, 6, 0, .14);
  background: #0e0e12;
}
.input.invalid { border-color: rgba(255, 70, 70, .8); }

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

.field-error { display: block; margin-top: 6px; font-size: 12.5px; color: #ff6b5e; min-height: 16px; }

.form-alert {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 70, 70, .35);
  background: rgba(225, 6, 0, .1);
  color: #ff8a80;
}
.form-alert.show { display: flex; }
.form-alert.ok { border-color: rgba(34, 197, 94, .35); background: rgba(34, 197, 94, .1); color: #7ee2a8; }

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.checkbox input { accent-color: var(--red); width: 16px; height: 16px; margin-top: 2px; }

.form-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
  color: var(--muted);
  font-size: 12px;
}
.form-divider::before, .form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* --------------------------------- Spinner -------------------------------- */

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

.loading-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 14px;
}
.loading-block .spinner { width: 26px; height: 26px; border-width: 3px; border-top-color: var(--red-2); }

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 56px 24px;
  color: var(--muted);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
}
.empty-state svg { color: #3a3a45; margin-bottom: 12px; }
.empty-state strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }

/* ---------------------------------- Toast --------------------------------- */

#toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 40px));
}

.toast {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  border-radius: var(--r-md);
  background: rgba(23, 23, 29, .96);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .9);
  font-size: 14px;
  animation: toast-in .28s cubic-bezier(.2, .9, .3, 1.2);
}
.toast.out { animation: toast-out .25s forwards; }
.toast .bar { width: 3px; align-self: stretch; border-radius: 3px; background: var(--muted); }
.toast.success .bar { background: var(--green); }
.toast.error .bar { background: var(--red-2); }
.toast.info .bar { background: #4b8cff; }

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

/* -------------------------------- Pílulas -------------------------------- */

.pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.pills::-webkit-scrollbar { display: none; }

.pill {
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s ease;
}
.pill:hover { color: var(--text); border-color: var(--line-2); }
.pill.active { background: var(--grad-red); border-color: transparent; color: #fff; }

/* ---------------------------- Busca (toolbar) ----------------------------- */

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.search-box { position: relative; flex: 1; min-width: 220px; max-width: 380px; }
.search-box svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box .input { height: 44px; padding-left: 42px; }
.push-right { margin-left: auto; }

/* ------------------------------ Cards de jogo ----------------------------- */

.grid-matches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.match-card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color .18s ease, transform .18s ease;
}
.match-card:hover { border-color: rgba(255, 45, 32, .45); transform: translateY(-3px); }

.match-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.match-league {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  overflow: hidden;
}
.match-league img { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.match-league span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.match-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}
.team { display: flex; flex-direction: column; align-items: center; gap: 9px; text-align: center; }
.team img { width: 46px; height: 46px; object-fit: contain; }
.team-name { font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.match-vs { font-family: var(--font-display); font-size: 12px; font-weight: 700; color: var(--muted); }
.match-time { font-size: 12px; font-weight: 700; color: var(--text-2); display: flex; align-items: center; gap: 5px; }

/* ------------------------------ Cards de canal ---------------------------- */

.grid-channels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
}

.channel-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  cursor: pointer;
  transition: all .18s ease;
  position: relative;
  overflow: hidden;
}
.channel-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120px 80px at 50% 0%, rgba(225, 6, 0, .18), transparent 70%);
  opacity: 0;
  transition: opacity .2s ease;
}
.channel-card:hover { border-color: rgba(255, 45, 32, .45); transform: translateY(-3px); }
.channel-card:hover::after { opacity: 1; }

.channel-logo {
  width: 100%;
  height: 68px;
  display: grid;
  place-items: center;
  background: #0d0d10;
  border-radius: 10px;
  border: 1px solid var(--line);
  overflow: hidden;
}
.channel-logo img { max-height: 48px; width: auto; object-fit: contain; }
.channel-name { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.channel-epg {
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* --------------------------------- Skeleton ------------------------------- */

.skeleton {
  background: linear-gradient(90deg, #16161b 25%, #1f1f26 37%, #16161b 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--r-md);
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

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

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

@media (max-width: 780px) {
  .wrap { padding: 0 18px; }
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 14px 18px 20px;
    background: rgba(8, 8, 10, .97);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    margin: 0;
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 13px 14px; font-size: 15px; }
  .nav .only-mobile { display: block; color: var(--red-2); font-weight: 600; }
  .nav-toggle { display: flex; order: 3; }
  .header-actions { margin-left: auto; }
  .user-chip-name { display: none; }
  .hide-mobile { display: none !important; }
}

@media (max-width: 560px) {
  body { font-size: 14.5px; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .site-footer { padding: 42px 0 32px; margin-top: 58px; }

  .grid-channels { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
  .grid-matches { grid-template-columns: 1fr; }

  .card { padding: 18px; border-radius: var(--r-md); }
  .btn-lg { height: 50px; padding: 0 20px; }
  .btn { padding: 0 16px; }

  .section-head { margin-bottom: 20px; }
  .section-head h2 { font-size: 22px; }

  .toolbar { gap: 10px; }
  .search-box { max-width: none; flex: 1 1 100%; }
  .push-right { margin-left: 0; flex: 1; }

  .match-card { padding: 15px; gap: 13px; }
  .team img { width: 40px; height: 40px; }
  .channel-card { padding: 12px 10px; }
  .channel-logo { height: 58px; }

  #toasts { right: 12px; left: 12px; bottom: 12px; max-width: none; }
}

/* Em telas de toque não existe hover: os cartões não devem "pular". */
@media (hover: none) {
  .card-hover:hover, .match-card:hover, .channel-card:hover, .feature:hover { transform: none; }
}
