:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #edf4f2;
  --text: #16211f;
  --muted: #66736f;
  --line: #dce4df;
  --brand: #0f8a7b;
  --brand-2: #ef6f61;
  --ok: #12805c;
  --warn: #b47b12;
  --danger: #c74343;
  --shadow: 0 12px 34px rgba(22, 33, 31, 0.11);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.app-shell { min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(246, 247, 244, 0.93);
  backdrop-filter: blur(14px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}
.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: white;
  font-weight: 900;
}
.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav button, .link-button, .icon-button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  min-height: 38px;
  padding: 8px 11px;
}
.nav button.active, .nav button:hover, .link-button:hover, .icon-button:hover {
  background: var(--surface-2);
  color: var(--text);
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 56px;
}
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 26px;
  align-items: center;
  min-height: 560px;
  padding-bottom: 28px;
}
.hero h1, .page-title h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 68px);
  line-height: 1.02;
}
.hero p, .page-title p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
  max-width: 680px;
}
.hero-media {
  min-height: 420px;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: var(--shadow);
  background: var(--surface-2);
}
.hero-media img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
  display: block;
}
.home-section {
  padding: 38px 0;
  border-top: 1px solid var(--line);
}
.section-heading {
  margin-bottom: 18px;
  max-width: 780px;
}
.section-heading h2 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.15;
}
.section-heading p, .feature-card p, .steps p, .faq-list p {
  color: var(--muted);
  line-height: 1.55;
}
.feature-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}
.feature-card p { margin: 0; }
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.steps div {
  border-left: 4px solid var(--brand);
  padding: 4px 16px 4px 14px;
}
.steps span {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--brand);
  font-weight: 900;
}
.steps strong {
  display: block;
  font-size: 18px;
}
.steps p { margin: 8px 0 0; }
.faq-section { padding-bottom: 10px; }
.faq-list {
  display: grid;
  gap: 10px;
}
.faq-list details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px 16px;
}
.faq-list summary {
  cursor: pointer;
  font-weight: 800;
}
.faq-list p { margin: 10px 0 0; }

.cta-row, .actions, .form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}
.button.primary { border-color: var(--brand); background: var(--brand); color: white; }
.button.danger { border-color: #f1c8c8; background: #fff5f4; color: var(--danger); }
.button:disabled { opacity: 0.55; cursor: not-allowed; }
.button.google {
  justify-content: center;
  border-color: #d9e1dd;
  background: #ffffff;
  color: #25312e;
}
.button.google:hover {
  border-color: #c7d8d2;
  background: #f8fbfa;
}
.google-mark {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: conic-gradient(from -45deg, #4285f4 0 25%, #34a853 0 50%, #fbbc05 0 75%, #ea4335 0);
  color: white;
  font-weight: 900;
  font-size: 14px;
}
.button.whatsapp {
  border-color: #1fae63;
  background: #e9fff4;
  color: #0f6b3d;
}
.button.whatsapp:hover {
  background: #d7f7e8;
}
.whatsapp-mark {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: #1fae63;
  color: white;
  font-size: 12px;
  font-weight: 900;
}

.grid { display: grid; gap: 14px; }
.grid.stats { grid-template-columns: repeat(5, 1fr); margin: 22px 0; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 4px 14px rgba(22, 33, 31, 0.05);
}
.card.pad { padding: 18px; }
.stat strong { display: block; font-size: 28px; }
.stat span, .muted, .field span, .mini { color: var(--muted); }
.section-title { margin: 0 0 12px; font-size: 18px; }

.table-list { display: grid; gap: 10px; }
.raffle-row {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
}
.thumb {
  width: 76px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-2);
}
.progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ece8;
  margin-top: 8px;
}
.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.badge.draft { background: #eef0ee; color: #54605d; }
.badge.pending { background: #fff4d6; color: #7a530b; }
.badge.published { background: #dff5ee; color: #0b6045; }
.badge.closed { background: #e9ecf3; color: #44506d; }
.badge.cancelled { background: #fae4e1; color: #983333; }

.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 750; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--text);
  min-height: 42px;
  padding: 10px 11px;
}
.field textarea { min-height: 100px; resize: vertical; }
.image-picker {
  align-content: start;
}
.image-preview {
  width: 100%;
  max-height: 320px;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}
.image-picker input[type="file"] {
  padding: 8px;
}

.number-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
  gap: 7px;
  margin-top: 14px;
}
.number-cell {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  font-weight: 800;
}
.number-cell.available { border-color: #b9dfcf; background: #ecfaf5; color: var(--ok); }
.number-cell.reserved { border-color: #efd489; background: #fff8df; color: var(--warn); }
.number-cell.sold { border-color: #efb2ad; background: #fff0ee; color: var(--danger); }
.number-cell.selected { outline: 3px solid rgba(15, 138, 123, 0.24); }
.number-cell[data-buy-number] { cursor: pointer; }
.number-cell[data-buy-number]:hover { box-shadow: 0 0 0 3px rgba(15, 138, 123, 0.12); }
.number-cell[data-buy-number].selected {
  border-color: var(--brand);
  background: var(--brand);
  color: white;
}
.number-cell:disabled { cursor: not-allowed; }
.purchase-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.public-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}
.public-cover {
  width: 100%;
  aspect-ratio: 16 / 8;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-2);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  background: white;
  color: var(--muted);
}
.number-legend span { font-weight: 800; }
.number-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}
.number-legend .available { border-color: #b9dfcf; background: #ecfaf5; color: var(--ok); }
.number-legend .available i { background: var(--ok); }
.number-legend .reserved { border-color: #efd489; background: #fff8df; color: var(--warn); }
.number-legend .reserved i { background: var(--warn); }
.number-legend .sold { border-color: #efb2ad; background: #fff0ee; color: var(--danger); }
.number-legend .sold i { background: var(--danger); }

.payment-box { display: grid; gap: 12px; }
.qr {
  display: grid;
  width: 150px;
  height: 150px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, #111 10px, transparent 10px) 0 0 / 30px 30px,
    linear-gradient(#111 10px, transparent 10px) 0 0 / 30px 30px,
    white;
}
.qr span {
  padding: 5px 8px;
  border-radius: 6px;
  background: white;
  font-size: 12px;
  font-weight: 800;
}
.qr-image {
  width: 180px;
  height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  object-fit: contain;
  padding: 8px;
}
.notice {
  border-left: 4px solid var(--brand);
  background: #eaf7f4;
  padding: 12px 14px;
  border-radius: 8px;
  color: #184a43;
}
.winner { border-color: #f0d47b; background: #fff8dc; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

@media (max-width: 880px) {
  .hero, .grid.two, .grid.three, .public-layout { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .grid.stats { grid-template-columns: repeat(2, 1fr); }
  .raffle-row { grid-template-columns: 60px 1fr; }
  .raffle-row .actions { grid-column: 1 / -1; }
  .topbar { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 560px) {
  .page { width: min(100% - 22px, 1180px); }
  .grid.stats { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .hero-media, .hero-media img { min-height: 280px; }
}
