/* ============================================================
   Festival Dia das Crianças — Design System
   Fonte: Fredoka One (títulos) + Nunito (corpo)
============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@400;600;700;800&display=swap');

/* ---- VARIÁVEIS ---- */
:root {
  --amarelo: #FFD93D;
  --laranja: #FF6B35;
  --verde:   #06D6A0;
  --rosa:    #FF6B9D;
  --azul:    #4CC9F0;
  --roxo:    #7B2FBE;
  --bg:      #FFF8F0;
  --card:    #FFFFFF;
  --txt:     #1A1A2E;
  --txt2:    #6B7280;
  --border:  #E5E7EB;
  --danger:  #EF4444;
  --success: #10B981;
  --warning: #F59E0B;
  --shadow:  0 4px 24px rgba(255,107,53,0.10);
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--txt);
  min-height: 100vh;
  line-height: 1.6;
}
a { color: var(--laranja); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ---- HEADER DO SITE ---- */
.site-header {
  background: linear-gradient(135deg, var(--laranja) 0%, var(--rosa) 55%, var(--roxo) 100%);
  padding: 2.5rem 1rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.site-header::before {
  content: '🎈🎊🎠🎡🎢🎪🎈🎊🎠🎡🎢🎪🎈🎊🎠🎡🎢🎪';
  position: absolute;
  top: 10px; left: 0; right: 0;
  font-size: 1.3rem;
  opacity: 0.25;
  letter-spacing: 6px;
  white-space: nowrap;
  overflow: hidden;
  pointer-events: none;
}
.site-header h1 {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(2rem, 7vw, 3.5rem);
  color: #fff;
  text-shadow: 3px 3px 0 rgba(0,0,0,0.12);
  position: relative;
}
.site-header .subtitle {
  color: rgba(255,255,255,0.88);
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 4px;
  position: relative;
}
.date-badge {
  display: inline-block;
  background: var(--amarelo);
  color: var(--txt);
  font-family: 'Fredoka One', cursive;
  font-size: 1rem;
  padding: 6px 22px;
  border-radius: 30px;
  margin-top: 1rem;
  position: relative;
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

/* ---- NAVEGAÇÃO ---- */
.site-nav {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.site-nav ul {
  list-style: none;
  display: flex;
  max-width: 780px;
  margin: 0 auto;
  overflow-x: auto;
}
.site-nav ul li a {
  display: block;
  padding: 1rem 1.2rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--txt2);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
.site-nav ul li a:hover,
.site-nav ul li a.active {
  color: var(--laranja);
  border-bottom-color: var(--laranja);
  text-decoration: none;
}

/* ---- LAYOUT ---- */
.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}
.container-sm {
  max-width: 480px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

/* ---- CARD ---- */
.card {
  background: var(--card);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.card-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.55rem;
  color: var(--laranja);
  margin-bottom: 0.25rem;
}
.card-sub {
  color: var(--txt2);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* ---- FORMULÁRIO ---- */
.field { margin-bottom: 1.2rem; }
.field label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--txt);
}
.field label .req { color: var(--laranja); }
.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  font-family: 'Nunito', sans-serif;
  background: #FAFAFA;
  color: var(--txt);
  transition: border-color 0.2s, background 0.2s;
  outline: none;
  appearance: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--laranja);
  background: #fff;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 500px) { .row2 { grid-template-columns: 1fr; } }

/* ---- BOTÕES ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 14px;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  text-decoration: none;
  line-height: 1;
}
.btn:active { transform: scale(0.97); }
.btn-block { width: 100%; margin-top: 0.5rem; }
.btn-sm { padding: 8px 16px; font-size: 0.88rem; border-radius: 10px; }

.btn-primary {
  background: linear-gradient(135deg, var(--laranja), var(--rosa));
  color: #fff;
  box-shadow: 0 4px 16px rgba(255,107,53,0.28);
}
.btn-primary:hover {
  box-shadow: 0 6px 22px rgba(255,107,53,0.42);
  transform: translateY(-1px);
  color: #fff;
  text-decoration: none;
}

.btn-wa {
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #fff;
  box-shadow: 0 4px 16px rgba(37,211,102,0.28);
}
.btn-wa:hover {
  box-shadow: 0 6px 22px rgba(37,211,102,0.42);
  transform: translateY(-1px);
  color: #fff;
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--laranja);
  color: var(--laranja);
}
.btn-outline:hover { background: #FFF0EA; text-decoration: none; color: var(--laranja); }

.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 4px 12px rgba(239,68,68,0.25);
}
.btn-success {
  background: var(--success);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16,185,129,0.25);
}
.btn-secondary {
  background: #F3F4F6;
  color: var(--txt);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); color: var(--txt); text-decoration: none; }

/* ---- ALERTAS ---- */
.alert {
  padding: 14px 18px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  line-height: 1.5;
}
.alert-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.alert-info    { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }
.alert-warning { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.alert-success { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.alert-danger  { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }

/* ---- BADGES ---- */
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge-green   { background: #D1FAE5; color: #065F46; }
.badge-yellow  { background: #FEF3C7; color: #92400E; }
.badge-red     { background: #FEE2E2; color: #991B1B; }
.badge-blue    { background: #DBEAFE; color: #1E40AF; }
.badge-purple  { background: #EDE9FE; color: #5B21B6; }

/* ---- INDICADOR DE PASSOS ---- */
.steps {
  display: flex;
  align-items: flex-start;
  margin-bottom: 2rem;
  position: relative;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  text-align: center;
}
.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 18px;
  left: 50%;
  right: -50%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.step.done:not(:last-child)::after  { background: var(--verde); }
.step.active:not(:last-child)::after { background: var(--border); }

.step-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  background: var(--border);
  color: var(--txt2);
  position: relative;
  z-index: 1;
  transition: all 0.3s;
}
.step.done   .step-circle { background: var(--verde); color: #fff; }
.step.active .step-circle { background: var(--laranja); color: #fff; box-shadow: 0 0 0 4px rgba(255,107,53,0.2); }

.step-label {
  font-size: 0.7rem;
  font-weight: 700;
  margin-top: 6px;
  color: var(--txt2);
  line-height: 1.3;
}
.step.active .step-label { color: var(--laranja); }
.step.done   .step-label { color: var(--verde); }

/* ---- BILHETE VISUAL ---- */
.ticket {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.13);
  border: 1px solid rgba(0,0,0,0.06);
  margin-bottom: 1.5rem;
}
.ticket-top {
  background: linear-gradient(135deg, var(--laranja) 0%, var(--rosa) 60%, var(--roxo) 100%);
  padding: 1.5rem 1.75rem 1.75rem;
  position: relative;
  overflow: hidden;
}
.ticket-top::after {
  content: '🎈🎊🎠🎡';
  position: absolute;
  top: 10px; right: 16px;
  font-size: 1.4rem;
  opacity: 0.25;
  letter-spacing: 4px;
}
.ticket-top h2 {
  font-family: 'Fredoka One', cursive;
  font-size: 1.6rem;
  color: #fff;
  text-shadow: 1px 2px 0 rgba(0,0,0,0.1);
}
.ticket-top p { color: rgba(255,255,255,0.85); font-size: 0.9rem; font-weight: 600; margin-top: 4px; }

.ticket-divider {
  position: relative;
  height: 1px;
  overflow: visible;
}
.ticket-divider::before {
  content: '';
  position: absolute;
  left: 20px; right: 20px; top: 0;
  border-top: 2px dashed #E5E7EB;
}
.ticket-notch {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg);
  position: absolute;
  top: -14px;
  border: 1px solid var(--border);
}
.ticket-notch.left  { left: -14px; }
.ticket-notch.right { right: -14px; }

.ticket-body {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem 1.75rem;
  align-items: flex-start;
}
.ticket-info { flex: 1; }
.t-row { margin-bottom: 14px; }
.t-row:last-child { margin-bottom: 0; }
.t-label {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--txt2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}
.t-value { font-size: 1rem; font-weight: 700; color: var(--txt); }

.ticket-qr-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 115px;
}
.ticket-qr-side img { border-radius: 6px; border: 2px solid var(--border); }
.ticket-qr-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--txt2);
  text-align: center;
  line-height: 1.3;
}

.ticket-footer {
  border-top: 1px solid var(--border);
  padding: 10px 1.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #FAFAFA;
}
.ticket-code {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--txt2);
  letter-spacing: 0.1em;
}

/* ---- ADMIN LAYOUT ---- */
.admin-wrap {
  display: flex;
  min-height: 100vh;
}
.admin-sidebar {
  width: 230px;
  background: var(--txt);
  padding: 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand h2 {
  font-family: 'Fredoka One', cursive;
  color: var(--amarelo);
  font-size: 1.15rem;
  line-height: 1.3;
}
.sidebar-brand p { color: rgba(255,255,255,0.45); font-size: 0.78rem; margin-top: 3px; }
.sidebar-nav { padding: 1rem 0; flex: 1; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 1.25rem;
  color: rgba(255,255,255,0.65);
  font-weight: 700;
  font-size: 0.88rem;
  transition: all 0.2s;
  text-decoration: none;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: #fff;
  background: rgba(255,255,255,0.08);
  border-left: 3px solid var(--laranja);
  padding-left: calc(1.25rem - 3px);
  text-decoration: none;
}
.sidebar-nav a .nav-icon { font-size: 1.1rem; }
.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-footer a {
  color: rgba(255,255,255,0.45);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}
.sidebar-footer a:hover { color: var(--danger); text-decoration: none; }

.admin-main {
  flex: 1;
  padding: 2rem;
  overflow-x: auto;
}
.admin-page-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.7rem;
  color: var(--txt);
  margin-bottom: 1.5rem;
}

/* Stats bar */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 1.75rem;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  text-align: center;
}
.stat-num {
  font-family: 'Fredoka One', cursive;
  font-size: 2.4rem;
  color: var(--laranja);
  line-height: 1;
}
.stat-num.green  { color: var(--verde); }
.stat-num.yellow { color: var(--warning); }
.stat-num.red    { color: var(--danger); }
.stat-lbl { font-size: 0.8rem; font-weight: 700; color: var(--txt2); margin-top: 4px; }

/* Tabela admin */
.table-wrap {
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  overflow-x: auto;
}
.table-header {
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}
.table-header h3 {
  font-family: 'Fredoka One', cursive;
  font-size: 1.2rem;
  color: var(--txt);
}
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
table.data-table th {
  background: #F9FAFB;
  padding: 11px 14px;
  text-align: left;
  font-weight: 800;
  color: var(--txt2);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
table.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: #FFFBF5; }

/* Filter bar */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-bar a {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--txt2);
  background: #F3F4F6;
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all 0.15s;
}
.filter-bar a:hover, .filter-bar a.active {
  background: var(--laranja);
  color: #fff;
  border-color: var(--laranja);
  text-decoration: none;
}

/* Código de reserva em destaque */
.codigo-box {
  background: #F3F4F6;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 20px;
  font-family: 'Courier New', monospace;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-align: center;
  color: var(--txt);
  word-break: break-all;
}

/* Caixa pendente */
.pending-box {
  background: linear-gradient(135deg, #FFF7ED, #FFFBEB);
  border: 2px solid var(--amarelo);
  border-radius: 18px;
  padding: 2rem;
  text-align: center;
  margin: 1.5rem 0;
}
.pending-box .big-icon { font-size: 3.5rem; margin-bottom: 0.75rem; }
.pending-box h3 {
  font-family: 'Fredoka One', cursive;
  font-size: 1.4rem;
  color: var(--laranja);
  margin-bottom: 0.5rem;
}
.pending-box p { color: var(--txt2); font-size: 0.95rem; line-height: 1.6; }

/* Scanner */
#qr-reader { width: 100%; }
#qr-reader video { border-radius: 12px; }
.scanner-box {
  border: 2px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  min-height: 260px;
  margin-bottom: 1rem;
}
.scan-result { margin-top: 1rem; }
.scan-result .result-card {
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
}
.scan-result .result-card.valid   { background: #ECFDF5; color: #065F46; border: 2px solid #A7F3D0; }
.scan-result .result-card.invalid { background: #FEF2F2; color: #991B1B; border: 2px solid #FECACA; }
.scan-result .result-card .big { font-size: 3rem; display: block; margin-bottom: 0.5rem; }
.scan-counters {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 10px;
  margin-top: 1.5rem;
}

/* Responsivo mobile para admin */
@media (max-width: 720px) {
  .admin-sidebar { display: none; }
  .admin-main { padding: 1rem; }
  .admin-wrap { flex-direction: column; }
}

/* ---- IMPRESSÃO ---- */
@media print {
  .site-nav, .site-header, .btn, .no-print,
  .admin-sidebar, nav { display: none !important; }
  .ticket { box-shadow: none; border: 2px solid #ddd; }
  body { background: #fff; }
  .container, .admin-main { padding: 0; }
}
