:root {
  color-scheme: light dark;
  --bg: #faf6ef;
  --bg-gradient: radial-gradient(ellipse 900px 500px at 50% -10%, #fdf0e4 0%, #faf6ef 55%);
  --fg: #26221d;
  --muted: #857c6c;
  --accent: #b0502e;
  --accent-soft: #f3e2d8;
  --card: #ffffff;
  --border: #ece3d4;
  --shadow: 0 1px 2px rgba(60, 40, 20, 0.04), 0 12px 32px -16px rgba(60, 40, 20, 0.18);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1714;
    --bg-gradient: radial-gradient(ellipse 900px 500px at 50% -10%, #2a1d16 0%, #1a1714 55%);
    --fg: #f1ece2;
    --muted: #a89d8a;
    --accent: #e08a5f;
    --accent-soft: #3a271d;
    --card: #23201b;
    --border: #382f26;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 12px 32px -16px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-gradient);
  color: var(--fg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 3rem 1.25rem 5rem;
}

.logo {
  height: 34px;
  width: auto;
  display: block;
}

@media (prefers-color-scheme: dark) {
  .logo, .hero-logo {
    filter: brightness(1.3) saturate(1.05);
  }
}

.hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.hero-logo {
  height: 46px;
  width: auto;
  margin: 0 auto 1.75rem;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.event-title {
  font-size: 1.55rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

.hero .subtitle {
  color: var(--muted);
  margin-top: 0.6rem;
  margin-bottom: 0;
  font-size: 0.98rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem 1.75rem 2rem;
  box-shadow: var(--shadow);
}

fieldset {
  border: none;
  padding: 0;
  margin: 0 0 1.75rem;
}

fieldset + fieldset {
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}

legend {
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
  padding: 0;
  width: 100%;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  font-size: 0.92rem;
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="number"],
textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg);
  color: var(--fg);
  font-size: 1rem;
  margin-bottom: 1.25rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea {
  min-height: 4.5rem;
  resize: vertical;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-weight: 400;
  font-size: 0.95rem;
  line-height: 1.45;
  cursor: pointer;
}

.checkbox-row input {
  margin-top: 0.2rem;
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

.note {
  font-size: 0.85rem;
  color: var(--muted);
}

.disclaimer {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  font-size: 0.87rem;
  color: var(--muted);
  margin-top: 1.25rem;
  margin-bottom: 1.1rem;
  max-height: 220px;
  overflow-y: auto;
}

button {
  width: 100%;
  padding: 0.85rem;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.05s ease;
}

button:hover:not(:disabled) {
  filter: brightness(1.06);
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.error {
  color: #c0392b;
  font-size: 0.88rem;
  margin: -0.6rem 0 1rem;
  display: none;
}

.hidden {
  display: none !important;
}

.confirmation h2 {
  margin-top: 0;
  font-size: 1.3rem;
}

.payment-box {
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  margin: 1.25rem 0;
  text-align: center;
}

.payment-box .phone {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--accent);
  margin: 0.4rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

td:first-child {
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.pill.paid {
  background: #dff3e3;
  color: #256d3a;
}

.pill.unpaid {
  background: var(--accent-soft);
  color: var(--accent);
}

.small-btn {
  width: auto;
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  border-radius: 8px;
  white-space: nowrap;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.wa-btn {
  display: inline-block;
  text-decoration: none;
  background: var(--accent);
  color: #fff;
}

.danger-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: #c0392b;
}

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

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.top-bar button {
  width: auto;
  padding: 0.55rem 1.1rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.admin-label {
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 640px) {
  table, thead, tbody, th, tr, td {
    display: block;
  }

  thead {
    display: none;
  }

  tbody tr {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.8rem 0.9rem;
    margin-bottom: 0.75rem;
  }

  tbody tr:last-child {
    margin-bottom: 0;
  }

  tbody td {
    border: none;
    padding: 0.3rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
  }

  tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
  }

  tbody td[data-label="Ações"] {
    display: block;
    margin-top: 0.5rem;
  }

  tbody td[data-label="Ações"]::before {
    display: block;
    margin-bottom: 0.5rem;
  }

  .actions {
    justify-content: flex-start;
  }
}
