:root {
  --rose: #D4696E;
  --rose-dark: #B9575C;
  --leaf: #86AE5B;
  --leaf-dark: #6B9145;
  --leaf-light: #BEE09C;
  --sand: #E3C48E;
  --sand-light: #F7EEDD;
  --cream: #FFFCF7;
  --ink: #3B2F2F;
  --muted: #7A6A64;
  --line: #EBDCC3;
  --radius: 20px;
  --shadow: 0 10px 30px rgba(120, 80, 40, 0.10);
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Nunito', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--ink);
  line-height: 1.5;
  background-color: var(--sand-light);
  background-image: radial-gradient(circle at 1px 1px, rgba(212, 105, 110, 0.12) 1px, transparent 0);
  background-size: 18px 18px;
}
img { max-width: 100%; display: block; }
a { color: var(--rose-dark); }
[hidden] { display: none !important; }

.shell { max-width: 480px; margin: 0 auto; padding: 20px 16px 40px; }
.shell.wide { max-width: 1040px; }
.brand { display: flex; justify-content: center; padding: 8px 0 18px; }
.logo { width: min(260px, 70vw); height: auto; }
.logo-sm { width: 120px; height: auto; }

.card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 20px;
  margin-bottom: 16px;
}
.eyebrow {
  margin: 0 0 4px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--leaf-dark);
}
h1, h2 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; margin: 0 0 8px; color: var(--rose-dark); }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
.lead { margin: 8px 0 18px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.grow { flex: 1; }

form label { display: block; font-weight: 700; margin-bottom: 14px; }
input:not([type]), input[type=text], input[type=tel], input[type=email], input[type=date], input[type=password] {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 14px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus { border-color: var(--rose); box-shadow: 0 0 0 4px rgba(212, 105, 110, 0.15); }

fieldset.goals { border: 0; padding: 0; margin: 0 0 16px; }
fieldset.goals legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .chip { display: inline-block; margin: 0; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: #fff;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chip input:checked + span { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.chip input:focus-visible + span { box-shadow: 0 0 0 4px rgba(134, 174, 91, 0.3); }

form .consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: 0.9rem; }
.consent input { width: 22px; height: 22px; flex: none; margin: 1px 0 0; accent-color: var(--rose); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s, background 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { width: 100%; background: var(--rose); color: #fff; }
.btn-primary:hover { background: var(--rose-dark); }
.btn-ghost { background: transparent; border-color: var(--rose); color: var(--rose-dark); }
.btn-small { min-height: 36px; padding: 6px 14px; font-size: 0.875rem; }
.btn-big { min-height: 64px; font-size: 1.25rem; }
.row { display: flex; gap: 10px; margin-top: 10px; }
.row > * { flex: 1; }

.form-error {
  background: #FCE8E8;
  color: #9B3338;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 700;
  margin: 0 0 14px;
}

.confirm { text-align: center; }
.lucky {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 4.5rem;
  line-height: 1;
  color: var(--rose);
  margin: 6px 0 10px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.lucky.pop { animation: pop 0.45s ease-out; }
@keyframes pop { 0% { transform: scale(0.85); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
.coupon { border: 2px dashed var(--leaf); border-radius: 16px; background: #F3F9EC; padding: 14px; margin: 18px 0; }
.coupon p { margin: 0 0 6px; font-weight: 700; color: var(--leaf-dark); }
.coupon .coupon-title { font-family: var(--font-display); font-size: 1.35rem; color: var(--rose-dark); margin-bottom: 2px; }
.coupon-code { display: flex; align-items: center; justify-content: center; gap: 12px; }
.coupon-code strong { font-size: 1.5rem; letter-spacing: 0.08em; }

/* Painel */
.admin-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.admin-head h1 { flex: 1; margin: 0; }
.grid-form { display: grid; gap: 4px 16px; }
@media (min-width: 720px) {
  .grid-form { grid-template-columns: 1fr 1fr; }
  .grid-form .btn { grid-column: 1 / -1; }
}
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.925rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 800; }
.badge.open { background: #E8F4DC; color: var(--leaf-dark); }
.badge.closed { background: #EEE6E4; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.actions .btn-primary { width: auto; }
.actions form { margin: 0; }
.qr { width: 100%; max-width: 260px; margin: 8px auto 14px; background: #fff; border-radius: 12px; padding: 8px; }
.link-box {
  display: flex;
  gap: 8px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 0.875rem;
  word-break: break-all;
}
.two-col { display: grid; gap: 16px; }
@media (min-width: 860px) { .two-col { grid-template-columns: 2fr 1fr; } }

/* Tela de sorteio */
.stage { max-width: 1200px; margin: 0 auto; padding: 16px; }
.stage-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.stage-head h1 { margin: 0; }
.stage-grid { display: grid; gap: 16px; }
@media (min-width: 900px) {
  .stage-grid { grid-template-columns: 2fr 1fr; }
  .stage-main { grid-row: span 2; }
}
.stage-main { text-align: center; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.counter { font-size: 1.25rem; margin: 0; }
.counter strong { font-family: var(--font-display); font-size: 2.25rem; color: var(--leaf-dark); }
.lucky.big { font-size: clamp(5rem, 22vw, 11rem); margin: 0; }
.lucky.spinning { color: var(--sand); }
.winner { font-size: clamp(1.25rem, 4vw, 2rem); font-weight: 800; min-height: 1.5em; margin: 0; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; gap: 10px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); }
.history li:first-child strong { color: var(--rose); }
.history strong { font-family: var(--font-display); font-size: 1.4rem; min-width: 70px; }
.history time { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.stage-foot { text-align: center; margin-top: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.link-box .grow { -webkit-user-select: all; user-select: all; }
.wa-link { color: var(--leaf-dark); font-weight: 700; text-decoration: none; border-bottom: 1.5px solid var(--leaf-light); }
.wa-link:hover { color: var(--rose-dark); border-color: var(--rose); }
