:root {
  color-scheme: dark;
  --page-bg: #050505;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.74);
  --line: rgba(255, 255, 255, 0.18);
  --panel: rgba(8, 8, 8, 0.78);
  --panel-strong: rgba(14, 14, 14, 0.92);
  --gold: #ffd35c;
  --gold-dark: #b87516;
  --danger: #ff7a7a;
  --success: #8cffb3;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  color: var(--text);
  background-color: var(--page-bg);
  background-image: url("../../img/background-preto-fallback.jpg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
}

@supports (background-image: image-set(url("../../img/background-preto.webp") type("image/webp"))) {
  body {
    background-image: image-set(
      url("../../img/background-preto.webp") type("image/webp"),
      url("../../img/background-preto-fallback.jpg") type("image/jpeg")
    );
  }
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(115deg, rgba(3, 3, 3, 0.84) 0%, rgba(3, 3, 3, 0.62) 48%, rgba(3, 3, 3, 0.42) 100%),
    radial-gradient(circle at 50% 45%, rgba(0, 0, 0, 0.14), transparent 34%);
}

a {
  color: inherit;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 62px) 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold);
  font-size: 0.84rem;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
}

.admin-link {
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 520px);
  gap: clamp(26px, 5vw, 70px);
  align-items: start;
}

.hero-copy {
  padding-top: clamp(10px, 5vw, 68px);
}

.kicker {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin: 0 0 18px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-weight: 900;
}

h1 {
  max-width: 650px;
  font-size: clamp(2.8rem, 5.4vw, 5.1rem);
  line-height: 0.92;
  overflow-wrap: anywhere;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1;
}

.lead {
  max-width: 560px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.7vw, 1.12rem);
  font-weight: 700;
  line-height: 1.65;
}

.helper-link {
  display: inline-flex;
  margin-top: 22px;
  color: var(--gold);
  font-size: 0.96rem;
  font-weight: 900;
  text-decoration: none;
}

.helper-link:hover,
.helper-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, var(--panel), rgba(255, 255, 255, 0.08));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.form-panel,
.result-panel,
.admin-panel {
  padding: clamp(20px, 3vw, 32px);
}

.form-grid {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.88rem;
  font-weight: 900;
}

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  padding: 0 14px;
  outline: none;
}

.field select option {
  color: #111;
}

.field input:focus,
.field select:focus {
  border-color: rgba(255, 211, 92, 0.76);
  box-shadow: 0 0 0 4px rgba(255, 211, 92, 0.14);
}

.consent-box {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid rgba(255, 211, 92, 0.28);
  border-radius: 12px;
  background: rgba(255, 211, 92, 0.1);
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.5;
}

.consent-box input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--gold);
}

.privacy-link {
  display: inline;
  border: 0;
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.privacy-modal-panel {
  max-height: min(760px, calc(100vh - 34px));
  overflow: auto;
  text-align: left;
}

.privacy-modal-panel h2 {
  margin-bottom: 18px;
}

.privacy-text {
  display: grid;
  gap: 16px;
  margin-bottom: 22px;
}

.privacy-text p,
.privacy-text h3 {
  margin: 0;
}

.privacy-text p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.7;
}

.privacy-text h3 {
  color: var(--gold);
  font-size: 1rem;
  font-weight: 900;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 54px;
  padding: 0 26px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--gold), #ffb629 52%, var(--gold-dark));
  box-shadow: 0 16px 38px rgba(255, 181, 41, 0.23);
  color: #1b1003;
  cursor: pointer;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
}

.button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.6);
  opacity: 0.55;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.button.danger {
  border-color: rgba(255, 122, 122, 0.48);
  background: linear-gradient(135deg, #ff8d8d, #ff4f4f);
  box-shadow: 0 16px 38px rgba(255, 79, 79, 0.2);
  color: #220303;
}

.small-button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 11px;
  font-size: 0.78rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.errors {
  display: grid;
  gap: 8px;
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 122, 122, 0.35);
  border-radius: 12px;
  background: rgba(255, 122, 122, 0.1);
  color: var(--danger);
  font-weight: 800;
}

.success-note {
  margin: 18px 0 0;
  color: var(--success);
  font-weight: 900;
}

.code-box {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid rgba(255, 211, 92, 0.4);
  border-radius: 14px;
  background: rgba(255, 211, 92, 0.1);
}

.code-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.code-value {
  margin: 0;
  color: var(--gold);
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 900;
}

.qr-wrap {
  display: inline-grid;
  gap: 12px;
  justify-items: center;
  margin-top: 22px;
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  color: #10200f;
  font-size: 0.8rem;
  font-weight: 900;
}

.qr-wrap img {
  display: block;
  width: 220px;
  height: 220px;
}

.confirmation-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.confirmation-list p {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  font-weight: 700;
}

.confirmation-list strong {
  color: var(--text);
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

.admin-topbar {
  justify-content: space-between;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-menu-link,
.logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 900;
  text-decoration: none;
}

.admin-menu-link {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.78);
}

.admin-menu-link.is-active {
  border-color: rgba(255, 211, 92, 0.52);
  background: rgba(255, 211, 92, 0.16);
  color: var(--gold);
}

.logout-button {
  border: 1px solid rgba(255, 122, 122, 0.52);
  background: rgba(208, 40, 40, 0.86);
  color: #fff;
  box-shadow: 0 12px 26px rgba(208, 40, 40, 0.26);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0 22px;
}

.stat {
  min-width: 150px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.stat strong {
  display: block;
  margin-top: 4px;
  color: var(--gold);
  font-size: 1.8rem;
  font-weight: 900;
}

.draw-form {
  display: grid;
  grid-template-columns: minmax(220px, 380px) auto;
  gap: 12px;
  align-items: end;
  margin: 0 0 28px;
}

.draw-title-field {
  gap: 8px;
}

.draw-form .button {
  width: fit-content;
}

.admin-section {
  margin-top: 34px;
}

.admin-section.is-first {
  margin-top: 10px;
}

.admin-section h2 {
  margin-bottom: 14px;
}

.admin-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.admin-section-header h2 {
  margin-bottom: 0;
}

.report-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-filter-form {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(160px, 220px) auto;
  gap: 12px;
  align-items: end;
  margin: 0 0 18px;
}

.admin-filter-actions {
  display: flex;
  gap: 10px;
}

.admin-search-field input {
  min-width: 0;
}

.draw-box {
  display: grid;
  gap: 8px;
  margin: 0 0 24px;
  padding: 18px;
  border: 1px solid rgba(255, 211, 92, 0.42);
  border-radius: 16px;
  background: rgba(255, 211, 92, 0.12);
}

.draw-box span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.draw-box strong {
  color: var(--gold);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 900;
}

.draw-box p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 800;
}

.inline-form {
  margin: 0;
}

.bulk-form {
  display: grid;
  gap: 14px;
}

.bulk-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.bulk-summary {
  margin: 0 auto 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.bulk-select-all {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 900;
}

.bulk-checkbox,
.bulk-select-all input {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
  cursor: pointer;
}

.text-button {
  display: inline-flex;
  border: 0;
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 900;
  padding: 0;
  text-decoration: none;
}

.text-button.danger {
  color: var(--danger);
}

.phone-link {
  color: var(--gold);
  font-weight: 900;
  text-decoration: none;
}

.phone-link:hover,
.phone-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.draw-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.64);
  backdrop-filter: blur(10px);
}

.draw-modal.is-open {
  display: flex;
}

.draw-modal-panel {
  width: min(560px, 100%);
  padding: clamp(24px, 4vw, 36px);
  border: 1px solid rgba(255, 211, 92, 0.36);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(5, 24, 10, 0.96), rgba(35, 71, 16, 0.94));
  box-shadow: var(--shadow);
  text-align: center;
  animation: modalIn 240ms ease-out both;
}

.modal-kicker {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.84rem;
  font-weight: 900;
  text-transform: uppercase;
}

.spinner {
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  border: 5px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--gold);
  border-radius: 999px;
  animation: spin 820ms linear infinite;
}

.draw-result-grid {
  display: grid;
  gap: 10px;
  margin: 22px 0;
  text-align: left;
}

.draw-result-grid p {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.draw-result-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.draw-result-grid strong {
  color: var(--text);
  font-size: 1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1120px;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

td {
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.92rem;
  font-weight: 700;
}

.check-column {
  width: 42px;
  min-width: 42px;
  text-align: center;
  vertical-align: middle;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}

.pagination-link,
.pagination-page,
.pagination-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 900;
}

.pagination-link {
  border: 1px solid rgba(255, 211, 92, 0.36);
  background: rgba(255, 211, 92, 0.12);
  color: var(--gold);
  text-decoration: none;
}

.pagination-link.is-disabled {
  pointer-events: none;
  opacity: 0.42;
}

.pagination-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pagination-page {
  min-width: 38px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
}

.pagination-page.is-active {
  border-color: rgba(255, 211, 92, 0.54);
  background: rgba(255, 211, 92, 0.18);
  color: var(--gold);
}

.pagination-status {
  color: rgba(255, 255, 255, 0.82);
}

.empty-state {
  margin: 24px 0 0;
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 860px) {
  .page-shell {
    width: min(100% - 24px, 560px);
  }

  .topbar,
  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-nav,
  .admin-menu-link,
  .logout-button {
    width: 100%;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding-top: 0;
    text-align: center;
  }

  .hero-copy .kicker {
    justify-self: center;
  }

  .lead {
    margin-right: auto;
    margin-left: auto;
  }

  .button,
  .button-row {
    width: 100%;
  }

  .draw-form {
    grid-template-columns: 1fr;
  }

  .admin-filter-form {
    grid-template-columns: 1fr;
  }

  .admin-filter-actions {
    flex-direction: column;
  }

  .draw-form .button {
    width: 100%;
  }

  .confirmation-list p {
    align-items: flex-start;
    flex-direction: column;
  }
}
