:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #1e40af;
  --primary-2: #2563eb;
  --primary-soft: #dbeafe;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #f59e0b;
  --shadow: 0 18px 45px rgba(15, 23, 42, .08);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(37,99,235,.12), transparent 32rem),
    linear-gradient(180deg, #f8fafc 0%, var(--bg) 100%);
  min-height: 100vh;
}

.app-shell, .container {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0;
}

.hero-card, .reservation-flow, .stepper, .ticket, .modal-content {
  background: rgba(255,255,255,.9);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 4vw, 38px);
  margin-bottom: 18px;
  isolation: isolate;
}
.hero-card::before {
  content: '';
  position: absolute;
  inset: -40% auto auto -12%;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(37, 99, 235, .18), transparent 68%);
  z-index: -1;
}
.hero-card::after {
  content: '';
  position: absolute;
  right: -90px;
  bottom: -120px;
  width: 320px;
  height: 320px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(22, 163, 74, .12), transparent 68%);
  z-index: -1;
}
.brand-row {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 28px);
}
.logo {
  width: clamp(260px, 34vw, 430px);
  min-height: clamp(86px, 10vw, 120px);
  flex: 0 0 auto;
  border-radius: 28px;
  display: grid;
  place-items: center;
  padding: clamp(14px, 2vw, 22px);
  background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(248,250,252,.78));
  border: 1px solid rgba(148, 163, 184, .26);
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .10);
}
.logo img {
  width: 100%;
  height: auto;
  max-width: 390px;
  max-height: 110px;
  object-fit: contain;
  display: block;
}
.hero-card .eyebrow {
  margin-bottom: 6px;
}
.hero-card h1 {
  max-width: 720px;
}
.hero-card p {
  max-width: 680px;
  font-size: clamp(.98rem, 2vw, 1.08rem);
}
.eyebrow { display: inline-flex; color: var(--primary); font-weight: 800; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); margin: 4px 0 6px; line-height: 1.05; }
.hero-card p, .section-heading p, .helper-text { color: var(--muted); margin-bottom: 0; }

.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 12px; margin-bottom: 18px; }
.stepper-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px;
  border-radius: 16px;
  color: var(--muted);
  border: 1px solid transparent;
}
.stepper-item span {
  width: 32px; height: 32px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-weight: 900;
}
.stepper-item.active { background: var(--primary-soft); color: var(--primary); border-color: rgba(37,99,235,.2); }
.stepper-item.active span { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: white; border-color: transparent; }

.reservation-flow { padding: clamp(18px, 4vw, 34px); }
.step { display: none; animation: fadeIn .25s ease; }
.step.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.section-heading { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 24px; }
.section-badge {
  width: 42px; height: 42px; border-radius: 15px;
  display: grid; place-items: center;
  color: white; font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 12px 24px rgba(37,99,235,.22);
}
.section-badge.success { background: linear-gradient(135deg, #15803d, #22c55e); }
.section-heading h2 { margin: 0 0 4px; font-size: clamp(1.35rem, 3vw, 2rem); }

.day-options, .ticket-options { display: grid; gap: 14px; margin-bottom: 24px; }
.day-option, .option-card {
  width: 100%; text-align: left;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 18px;
  padding: 18px;
  cursor: pointer;
  transition: .18s ease;
  color: var(--text);
}
.day-option { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.day-option:hover, .option-card:hover { transform: translateY(-2px); border-color: rgba(37,99,235,.55); box-shadow: 0 12px 28px rgba(15,23,42,.08); }
.day-option.selected, .option-card.selected { background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(37,99,235,.05)); border-color: var(--primary-2); box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
.day-name { font-size: 1.05rem; font-weight: 900; }
.day-availability { color: var(--muted); font-weight: 700; }
.option-card.disabled { opacity: .5; cursor: not-allowed; transform: none !important; }
.option-card h3 { color: var(--primary); margin-bottom: 10px; }
.availability { font-weight: 900; color: var(--success); }

form { display: grid; gap: 16px; }
.form-group { margin: 0; }
label { display: block; margin-bottom: 8px; font-weight: 800; color: var(--text); }
input, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  padding: 13px 15px;
  font-size: 1rem;
  outline: none;
  transition: .18s ease;
}
input:focus, select:focus { border-color: var(--primary-2); box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
input[readonly] { background: var(--surface-2); color: var(--muted); }

.choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.choice-card {
  width: auto;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  box-shadow: none;
  transition: .18s ease;
}
.choice-card span { display: inline; }
.choice-card:hover { border-color: var(--primary-2); background: rgba(37,99,235,.07); transform: translateY(-1px); }
.choice-card.selected { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: white; border-color: transparent; box-shadow: 0 10px 22px rgba(37,99,235,.22); }
.choice-empty { color: var(--muted); border: 1px dashed var(--border); border-radius: 14px; padding: 12px 14px; background: var(--surface-2); }
.choice-grid.disabled { opacity: .85; }
.helper-text { display: block; margin-top: 8px; font-size: .88rem; }

.form-actions { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.action-buttons { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.btn-next, .btn-back, .btn-action, .btn-print, .btn-download, .btn-reload {
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 900;
  font-size: .96rem;
  cursor: pointer;
  transition: .18s ease;
}
.btn-next, .btn-action, .btn-reload { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; }
.btn-back { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-next:hover, .btn-action:hover, .btn-back:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(15,23,42,.12); }
.btn-next:disabled, .btn-action:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.cancel { background: linear-gradient(135deg, #b91c1c, var(--danger)); }

.confirmation-message {
  text-align: center;
  padding: 16px;
  margin-bottom: 22px;
  border-radius: 18px;
  color: #166534;
  background: rgba(22, 163, 74, .1);
  border: 1px solid rgba(22, 163, 74, .18);
}
.confirmada { font-weight: 900; font-size: 1.15rem; margin-bottom: 6px; }
.tickets-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.ticket { padding: 18px; max-width: 360px; margin: 0 auto; width: 100%; border-radius: 20px; }
.ticket-header { text-align: center; padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.ticket-header h3 { color: var(--primary); margin: 0; }
.ticket-info p { margin: 8px 0; }
.ticket-info strong { color: var(--text); }
.ticket-qr { width: 124px; height: 124px; margin: 16px auto 0; display: grid; place-items: center; }
.ticket-qr img { width: 120px !important; height: 120px !important; object-fit: contain; }

.error-message {
  display: none;
  width: min(980px, calc(100% - 32px));
  margin: 14px auto 0;
  padding: 14px 16px;
  border-radius: 16px;
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fecaca;
  text-align: center;
  font-weight: 800;
}
.temp-message { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow); font-weight: 800; }
.temp-message.success { background: #dcfce7; color: #166534; }
.temp-message.error { background: #fee2e2; color: #991b1b; }
.modal { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 999; padding: 24px; }
.modal-content { width: min(460px, 100%); margin: 10vh auto; padding: 24px; }
.close { float: right; cursor: pointer; font-size: 1.4rem; }
.app-footer { width: min(1080px, calc(100% - 32px)); margin: 0 auto 24px; text-align: center; color: var(--muted); font-weight: 700; }

@media (max-width: 720px) {
  .app-shell, .container { width: min(100% - 20px, 1080px); padding-top: 12px; }
  .hero-card { padding: 22px 18px; text-align: center; }
  .brand-row { flex-direction: column; align-items: center; gap: 14px; }
  .logo { width: min(92vw, 360px); min-height: 92px; border-radius: 24px; padding: 16px 18px; }
  .logo img { width: 100%; height: auto; max-width: 320px; max-height: 88px; }
  .hero-card h1, .hero-card p { margin-left: auto; margin-right: auto; }
  .stepper { grid-template-columns: repeat(2, 1fr); }
  .stepper-item { padding: 10px; }
  .day-option { align-items: flex-start; flex-direction: column; }
  .choice-card { padding: 9px 12px; font-size: .92rem; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #020617;
    --surface: #0f172a;
    --surface-2: #111827;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --border: #1f2937;
    --primary: #2563eb;
    --primary-2: #60a5fa;
    --primary-soft: rgba(37,99,235,.18);
    --shadow: 0 22px 55px rgba(0,0,0,.35);
  }
  body {
    background:
      radial-gradient(circle at top left, rgba(96,165,250,.16), transparent 32rem),
      linear-gradient(180deg, #020617 0%, #0f172a 100%);
  }
  .hero-card, .reservation-flow, .stepper, .ticket, .modal-content { background: rgba(15,23,42,.92); }
  .logo { background: linear-gradient(145deg, rgba(2, 6, 23, .92), rgba(15, 23, 42, .86)); border-color: rgba(148,163,184,.20); box-shadow: 0 18px 42px rgba(0,0,0,.36); }
  input, select, .day-option, .option-card, .choice-card { background: #111827; }
  input[readonly], .choice-empty, .btn-back { background: #0b1220; }
  .confirmation-message { color: #bbf7d0; background: rgba(22,163,74,.12); }
}

@media print {
  body * { visibility: hidden; }
  .ticket, .ticket * { visibility: visible; }
  .ticket { position: relative; width: 80mm; max-width: 80mm; box-shadow: none; border: none; page-break-after: always; }
  .action-buttons, .form-actions, .stepper, .hero-card, .checkbox-ticket { display: none !important; }
}

/* Toasts / alertas padronizados */
.toast-container {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.app-toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 34px 1fr 28px;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, .26);
  background: rgba(255,255,255,.92);
  color: #0f172a;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .16);
  backdrop-filter: blur(16px);
  animation: toastSlide .24s ease-out both;
}
.app-toast.leaving { animation: toastOut .22s ease-in both; }
.app-toast p { margin: 0; font-size: 14px; line-height: 1.35; font-weight: 650; }
.app-toast button { border: 0; background: transparent; color: inherit; font-size: 20px; cursor: pointer; opacity: .65; }
.toast-icon { width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center; font-weight: 900; }
.app-toast.success .toast-icon { background: rgba(34,197,94,.14); color: #16a34a; }
.app-toast.error .toast-icon { background: rgba(239,68,68,.14); color: #dc2626; }
.app-toast.warning .toast-icon { background: rgba(245,158,11,.16); color: #d97706; }
.app-toast.info .toast-icon { background: rgba(37,99,235,.14); color: #2563eb; }
@media (prefers-color-scheme: dark) {
  .app-toast { background: rgba(15, 23, 42, .92); color: #e5e7eb; border-color: rgba(148,163,184,.22); box-shadow: 0 18px 45px rgba(0,0,0,.35); }
}
@keyframes toastSlide { from { transform: translateX(18px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(18px); opacity: 0; } }


.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 6, 23, .68);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  opacity: 0;
  transition: opacity .22s ease;
}
.confirm-overlay.show { opacity: 1; }
.confirm-overlay.leaving { opacity: 0; }
.confirm-dialog {
  width: min(440px, calc(100vw - 32px));
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 24px;
  box-shadow: 0 28px 90px rgba(2, 6, 23, .35);
  padding: 0;
  overflow: hidden;
  transform: translateY(18px) scale(.96);
  opacity: .96;
  animation: confirmPop .22s cubic-bezier(.2,.8,.2,1) forwards;
}
.confirm-dialog::before {
  content: '';
  display: block;
  height: 5px;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}
.confirm-dialog.danger::before { background: linear-gradient(90deg, #dc2626, #fb7185); }
.confirm-dialog.warning::before { background: linear-gradient(90deg, #d97706, #fbbf24); }
.confirm-dialog.info::before { background: linear-gradient(90deg, #2563eb, #38bdf8); }
.confirm-content { padding: 22px 22px 0; }
.confirm-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 1.15rem;
  margin: 18px 22px 0;
  background: #fff7ed;
  color: #d97706;
  border: 1px solid rgba(217, 119, 6, .18);
}
.confirm-dialog.danger .confirm-icon { background: #fef2f2; color: #dc2626; border-color: rgba(220, 38, 38, .18); }
.confirm-dialog.info .confirm-icon { background: #eff6ff; color: #2563eb; border-color: rgba(37, 99, 235, .18); }
.confirm-content h3 { margin: 0 0 8px; font-size: 1.18rem; line-height: 1.25; color: inherit; }
.confirm-content p { margin: 0; color: #64748b !important; line-height: 1.55; font-size: .96rem; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 22px; margin-top: 0; }
.btn-confirm-cancel,
.btn-confirm-ok { border: 0; border-radius: 14px; padding: 12px 17px; font-weight: 850; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.btn-confirm-cancel { background: #f1f5f9 !important; color: #0f172a !important; }
.btn-confirm-ok { background: #2563eb !important; color: #ffffff !important; box-shadow: 0 12px 24px rgba(37, 99, 235, .22); }
.btn-confirm-ok.danger { background: #dc2626 !important; box-shadow: 0 12px 24px rgba(220, 38, 38, .24); }
.btn-confirm-cancel:hover,
.btn-confirm-ok:hover { transform: translateY(-1px); }
.btn-confirm-cancel:focus-visible,
.btn-confirm-ok:focus-visible { outline: 3px solid rgba(37, 99, 235, .24); outline-offset: 2px; }
@media (prefers-color-scheme: dark) {
  .confirm-overlay { background: rgba(2, 6, 23, .78); }
  .confirm-dialog { background: #0f172a !important; color: #e5e7eb !important; border-color: rgba(148, 163, 184, .26); box-shadow: 0 28px 90px rgba(0, 0, 0, .58); }
  .confirm-content p { color: #94a3b8 !important; }
  .confirm-icon { background: rgba(245, 158, 11, .13); color: #fbbf24; border-color: rgba(251, 191, 36, .2); }
  .confirm-dialog.danger .confirm-icon { background: rgba(239, 68, 68, .14); color: #f87171; border-color: rgba(248, 113, 113, .22); }
  .confirm-dialog.info .confirm-icon { background: rgba(37, 99, 235, .16); color: #93c5fd; border-color: rgba(147, 197, 253, .2); }
  .btn-confirm-cancel { background: rgba(148, 163, 184, .14) !important; color: #e5e7eb !important; }
}
@media (max-width: 520px) {
  .confirm-overlay { padding: 16px; }
  .confirm-actions { flex-direction: column-reverse; }
  .btn-confirm-cancel, .btn-confirm-ok { width: 100%; }
}
@keyframes confirmPop { to { transform: translateY(0) scale(1); opacity: 1; } }


/* Ações em linha na área do usuário */
.step-actions-inline {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.step-actions-inline .btn-next { margin-top: 0; }
.btn-consultar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid rgba(37, 99, 235, .22);
  background: rgba(37, 99, 235, .08);
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn-consultar:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, .10);
  background: rgba(37, 99, 235, .14);
}
.form-actions .btn-consultar.compact { flex: 1; }
@media (max-width: 640px) {
  .step-actions-inline { flex-direction: column; align-items: stretch; }
  .step-actions-inline .btn-next, .step-actions-inline .btn-consultar { width: 100%; }
}
@media (prefers-color-scheme: dark) {
  .btn-consultar {
    background: rgba(96, 165, 250, .12);
    border-color: rgba(96, 165, 250, .28);
    color: #bfdbfe;
  }
  .btn-consultar:hover { background: rgba(96, 165, 250, .18); }
}

/* Mobile polish - usuário */
@media (max-width: 760px) {
  html { -webkit-text-size-adjust: 100%; }
  body { overflow-x: hidden; }
  .app-shell {
    width: min(100% - 16px, 1120px) !important;
    padding-top: 14px !important;
  }
  .hero-card {
    border-radius: 24px !important;
    padding: 20px !important;
  }
  .brand-row {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 12px !important;
  }
  .brand-row .logo img,
  .logo img {
    width: min(78vw, 260px) !important;
    max-height: 120px !important;
    object-fit: contain;
  }
  .stepper {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  .stepper-item {
    justify-content: flex-start !important;
    padding: 10px !important;
  }
  .reservation-flow {
    padding: 18px !important;
    border-radius: 22px !important;
  }
  .section-heading {
    gap: 10px !important;
    margin-bottom: 18px !important;
  }
  .day-option {
    align-items: flex-start !important;
    flex-direction: column !important;
  }
  .form-actions,
  .action-buttons,
  .step-actions-inline {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .btn-next, .btn-back, .btn-action, .btn-print, .btn-download, .btn-reload, .btn-consultar {
    width: 100% !important;
    min-height: 46px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .choice-grid {
    gap: 8px !important;
  }
  .choice-card {
    max-width: 100%;
    white-space: normal !important;
    text-align: center !important;
  }
  input, select, textarea, button { font-size: 16px !important; }
}

@media (max-width: 420px) {
  .stepper { grid-template-columns: 1fr !important; }
  .section-badge { width: 36px !important; height: 36px !important; }
}
