/* Lusocasinoportal PT — Novo design 2025 — Redesign total, tema bandeira de Portugal */
/* =====================================================
   Reset & base
===================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}
:where(h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd) {
  margin: 0;
}
:where(ul[role="list"], ol[role="list"]) {
  list-style: none;
  margin: 0;
  padding: 0;
}
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
a {
  text-decoration-skip-ink: auto;
}
html:focus-within {
  scroll-behavior: smooth;
}
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

/* =====================================================
   Theme tokens — Light with Portuguese flag accents
===================================================== */
:root {
  /* Base neutrals */
  --pt-bg: #f7f9fb; /* page background */
  --pt-surface: #ffffff; /* base panels */
  --pt-elev: #f1f5f9; /* elevated cards */
  --pt-text: #0f172a; /* primary text (slate-900) */
  --pt-muted: #475569; /* secondary text (slate-600) */
  --pt-border: #e2e8f0; /* strokes (slate-200) */
  --pt-shadow: 0 10px 30px rgba(2, 6, 23, 0.08);
  --pt-radius: 16px;

  /* Portuguese flag palette */
  --pt-green: #046a38; /* Bandeira: verde */
  --pt-red: #c8102e; /* Bandeira: vermelho */
  --pt-gold: #ffb81c; /* Bandeira: amarelo dourado */
  --pt-navy: #0e1a2f; /* Profundidade para acentos escuros */

  /* Actions & focus */
  --pt-primary: var(--pt-green);
  --pt-primary-2: #0a7e45; /* hover */
  --pt-ring: rgba(255, 184, 28, 0.7); /* gold ring */
}

@media (prefers-color-scheme: dark) {
  :root {
    --pt-bg: #0c1118;
    --pt-surface: #0f1621;
    --pt-elev: #121c29;
    --pt-text: #e6edf5;
    --pt-muted: #a8b3c2;
    --pt-border: #1f2a37;
    --pt-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
    --pt-primary: #19a05b;
    --pt-primary-2: #21b867;
    --pt-ring: rgba(255, 184, 28, 0.55);
  }
}

/* =====================================================
   Base typography & body
===================================================== */
body {
  background: conic-gradient(
      from 200deg at 0% 0%,
      rgba(4, 106, 56, 0.1),
      transparent 35%
    ),
    conic-gradient(
      from 350deg at 100% 0%,
      rgba(200, 16, 46, 0.1),
      transparent 40%
    ),
    linear-gradient(180deg, var(--pt-bg) 0%, #fbfdff 40%, var(--pt-bg) 100%);
  color: var(--pt-text);
  font-family: "Inter Tight", system-ui, -apple-system, Segoe UI, Roboto, Arial,
    sans-serif;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Links and focus */
a {
  color: var(--pt-primary);
  text-decoration: none;
}
a:hover {
  color: var(--pt-primary-2);
  text-decoration: underline;
}
:where(a, button, .nx-cta):focus {
  outline: none;
}
:where(a, button, .nx-cta):focus-visible {
  outline: 3px solid var(--pt-ring);
  outline-offset: 3px;
  border-radius: 10px;
}

/* Utilities */
.nx-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;
}
.nx-skip {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.nx-skip:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: 10px 14px;
  background: var(--pt-gold);
  color: #0a0a0a;
  border-radius: 10px;
  z-index: 1000;
  box-shadow: var(--pt-shadow);
}
.mt-12 {
  margin-top: 12px;
}

/* =====================================================
   Layout wrappers
===================================================== */
.nx-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

/* =====================================================
   Hero — tri‑linha diagonal inspirada na bandeira
===================================================== */
header.nx-hero {
  isolation: isolate;
  border-radius: 28px;
  padding: 48px 24px;
  background: linear-gradient(
      160deg,
      rgba(4, 106, 56, 0.18) 0 22%,
      transparent 22% 27%,
      rgba(200, 16, 46, 0.18) 27% 49%,
      transparent 49% 54%,
      rgba(255, 184, 28, 0.2) 54% 78%,
      transparent 78%
    ),
    linear-gradient(180deg, var(--pt-surface), var(--pt-elev));
  border: 1px solid var(--pt-border);
  box-shadow: var(--pt-shadow);
  position: relative;
  overflow: hidden;
}

header.nx-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
      800px 280px at 90% -10%,
      rgba(200, 16, 46, 0.1),
      transparent 60%
    ),
    radial-gradient(
      600px 200px at 10% -10%,
      rgba(4, 106, 56, 0.12),
      transparent 65%
    );
}
.nx-hero h1 {
  font-family: "Sora", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Arial, sans-serif;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 12px;
  font-size: clamp(28px, 4.6vw, 42px);
}
.nx-hero p {
  margin: 0 0 16px;
  color: var(--pt-muted);
  max-width: 78ch;
}

/* Chips — estilo bilhete com entalhe */
.nx-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.nx-chip {
  position: relative;
  font-size: 12px;
  padding: 8px 12px 8px 16px;
  border-radius: 10px;
  border: 1px dashed var(--pt-border);
  color: var(--pt-text);
  background: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: var(--pt-shadow);
}
.nx-chip::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pt-gold);
  transform: translateY(-50%);
}
.nx-chip strong {
  color: var(--pt-red);
}

/* Seções — faixa tripla superior */
.nx-section {
  margin: 36px 0;
}
.nx-section h2 {
  font-family: "Sora", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Arial, sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 16px;
  font-size: clamp(18px, 2.4vw, 22px);
  color: var(--pt-navy);
  position: relative;
  padding-top: 14px;
}
.nx-section h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 6px;
  width: 120px;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    var(--pt-green),
    var(--pt-gold) 50%,
    var(--pt-red)
  );
}
.nx-note {
  color: var(--pt-muted);
  font-size: 14px;
}

/* Lista de cartões — geometria com canto chanfrado */
.nx-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.nx-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
  background: var(--pt-surface);
  border: 1px solid var(--pt-border);
  border-radius: var(--pt-radius);
  box-shadow: var(--pt-shadow);
  padding: 18px 18px 18px 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}

.nx-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(2, 6, 23, 0.12);
  border-color: #d7dee8;
}
.nx-card header {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 12px;
  flex-wrap: wrap;
}

/* Moldura do logo */
.nx-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 140px;
  padding: 15px;
  background: linear-gradient(180deg, #fff, var(--pt-elev));
  border: 1px solid var(--pt-border);
  border-radius: 12px;
  box-shadow: inset 0 0 0 4px rgba(4, 106, 56, 0.05), var(--pt-shadow);
}
.nx-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Posição — fita de destaque */
.nx-pos {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--pt-navy);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  border: 1px solid var(--pt-border);
  box-shadow: var(--pt-shadow);
}
.nx-pos::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 999px;
  padding: 2px;
  background: linear-gradient(
    90deg,
    var(--pt-green),
    var(--pt-gold),
    var(--pt-red)
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* Estrelas */
.nx-stars {
  color: var(--pt-gold);
  font-size: 16px;
  line-height: 1;
  padding: 4px 8px;
  background: var(--pt-elev);
  border: 1px solid var(--pt-border);
  border-radius: 10px;
}

/* Pílulas — blocos coloridos por categoria */
.nx-pills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.nx-pill {
  font-size: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  color: var(--pt-navy);
  border: 1px solid var(--pt-border);
  box-shadow: var(--pt-shadow);
}
.nx-pill:nth-child(3n + 1) {
  border-left: 6px solid var(--pt-green);
}
.nx-pill:nth-child(3n + 2) {
  border-left: 6px solid var(--pt-gold);
}
.nx-pill:nth-child(3n + 3) {
  border-left: 6px solid var(--pt-red);
}

/* Indicadores — barra segmentada tricolor */
.nx-meter {
  display: grid;
  gap: 8px;
}
.nx-meter strong {
  font-weight: 800;
  color: var(--pt-navy);
  font-size: 13px;
  letter-spacing: 0.02em;
}
.nx-bar {
  position: relative;
  height: 12px;
  background: var(--pt-elev);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--pt-border);
}
.nx-bar span {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    var(--pt-green) 0 33%,
    var(--pt-gold) 33% 66%,
    var(--pt-red) 66% 100%
  );
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.06);
}
.nx-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.05) 0 2px,
    transparent 2px 12px
  );
  pointer-events: none;
}

/* Ações & CTAs — primário verde, secundário vermelho */
.nx-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.nx-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--pt-primary), var(--pt-primary-2));
  color: #ffffff !important;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: 0.02em;
  box-shadow: 0 12px 26px rgba(4, 106, 56, 0.2);
  border: 1px solid rgba(4, 106, 56, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-transform: uppercase;
}
.nx-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(4, 106, 56, 0.3);
}
.nx-cta:focus-visible {
  outline: 3px solid var(--pt-ring);
  outline-offset: 3px;
}

/* Grades e blocos de conteúdo */
.nx-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.nx-grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.nx-box {
  background: var(--pt-surface);
  border: 1px solid var(--pt-border);
  border-radius: var(--pt-radius);
  padding: 16px;
  box-shadow: var(--pt-shadow);
}
.nx-center {
  display: grid;
  place-items: center;
}

/* Linhas de marcas / pagamentos / reguladores */
.nx-regs {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.nx-regs img {
  max-height: 32px;
  height: auto;
}

/* Secção "Melhor 2025" com moldura especial */
#sec-melhor-2025 .nx-card {
  border-width: 2px;
}
#sec-melhor-2025 .nx-card::before {
  opacity: 0.18;
}
#sec-melhor-2025 .nx-card {
  box-shadow: 0 14px 36px rgba(255, 184, 28, 0.18), var(--pt-shadow);
}

/* Rodapé — topo claro com barra tricolor, copy escuro */
footer {
  margin-top: 48px;
}
.nx-foot {
  border-top: 0;
  background: var(--pt-surface);
}
.nx-foot-top {
  position: relative;
  padding: 26px 24px;
  display: grid;
  gap: 14px;
}
.nx-foot-top::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 6px;
  width: 100%;
  background: linear-gradient(
    90deg,
    var(--pt-green),
    var(--pt-gold),
    var(--pt-red)
  );
}
.nx-legal {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.nx-legal a {
  color: var(--pt-navy);
  text-decoration: none;
  border-bottom: 2px solid rgba(4, 106, 56, 0.25);
  padding-bottom: 2px;
}
.nx-legal a:hover {
  color: var(--pt-red);
  border-bottom-color: rgba(200, 16, 46, 0.45);
}
.nx-18 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--pt-elev);
  color: var(--pt-navy);
  font-weight: 800;
  border: 1px solid var(--pt-border);
  box-shadow: var(--pt-shadow);
}
.nx-copy {
  background: linear-gradient(180deg, #0f172a, #0b1322);
  color: #e6edf5;
  border-top: none;
  padding: 12px 0;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

/* Tabelas (páginas legais) */
table {
  border-collapse: collapse;
  width: 100%;
  background: var(--pt-surface);
  color: var(--pt-text);
}
th,
td {
  border: 1px solid var(--pt-border);
  padding: 10px;
  text-align: left;
}
th {
  background: var(--pt-elev);
  color: var(--pt-navy);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 12px;
}
@media (max-width: 640px) {
  table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Responsivo */
@media (min-width: 720px) {
  .nx-card {
    grid-template-columns: 1.2fr 2fr 1fr;
    padding: 18px;
  }
  .nx-grid-2 {
    grid-template-columns: 1.2fr 1fr;
  }
  .nx-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  header.nx-hero {
    padding: 64px 32px;
  }
}

/* Preferências de movimento */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
.nx-copy .nx-note {
  color: var(--pt-elev);
}
@media (max-width: 767px) {
  header.nx-hero {
    padding: 10px;
  }
  .nx-hero .nx-chips {
    display: none;
  }
  #rot-licenciados {
    display: none;
  }
  .nx-hero p {
    margin-bottom: 0;
  }
  .nx-container {
    padding: 12px;
  }
  .nx-section {
    margin: 16px 0;
  }
  .nx-pos {
    position: relative;
    bottom: unset;
    right: unset;
  }
  .nx-card header {
    flex-direction: row;
    align-items: center;
    justify-content: center;
  }
  .nx-logo {
    height: 120px;
  }
  .nx-regs {
    justify-content: center;
  }
}
