/* ============================================================
   MINHA RESERVA — autoatendimento "Já comprou?"
   Página leve de propósito: sem GSAP/canvas/backdrop-filter —
   só a paleta e as fontes do site (styles.css) + este arquivo.
   ============================================================ */

/* Gotcha documentado do projeto: regra de classe com display definido vence o
   [hidden] do user-agent. Uma regra page-scoped mata a classe inteira do bug
   (passos, modal, botões e feedback alternam via hidden nesta página). */
.reserva-page [hidden] {
  display: none !important;
}

.reserva-page {
  min-height: 100vh;
  /* Sem background-attachment: fixed — iOS ignora e vira custo de scroll;
     o gradiente acompanha a altura real do documento (nunca sobra faixa). */
  background: var(--gradient-atmosphere) no-repeat;
  background-size: 100% 100%;
  color: var(--color-text);
  font-family: var(--font);
  display: flex;
  flex-direction: column;
}

/* Glows decorativos baratos: radial-gradient puro, sem filter (fluidez mobile) */
.reserva-glow {
  position: fixed;
  z-index: 0;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  pointer-events: none;
}
.reserva-glow--top {
  top: -30vmax;
  right: -20vmax;
  background: radial-gradient(circle, rgba(0, 191, 255, 0.14) 0%, transparent 62%);
}
.reserva-glow--bottom {
  bottom: -32vmax;
  left: -22vmax;
  background: radial-gradient(circle, rgba(139, 0, 255, 0.16) 0%, transparent 62%);
}

/* ---- Header enxuto: só a logo, volta pro site ---- */
.reserva-header {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  padding: 28px 16px 8px;
}
.reserva-header__link {
  display: inline-block;
  border-radius: 16px;
}
.reserva-header__link:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 4px;
}
.reserva-header__logo {
  width: 92px;
  height: 92px;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.45));
}

/* ---- Card central ---- */
.reserva-main {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 16px 48px;
}

.reserva-card {
  background: var(--surface-panel);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 28px 20px 32px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
}

.reserva-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 5.5vw, 2.25rem);
  line-height: 1.15;
  margin: 6px 0 8px;
}

.reserva-subtitle {
  color: var(--color-text-muted);
  font-size: var(--text-body-lg);
  margin-bottom: 24px;
}

/* ---- Passos ---- */
.reserva-step {
  display: block;
}

.reserva-hint {
  margin-top: 14px;
  font-size: var(--text-small);
  color: var(--color-text-muted);
  line-height: 1.55;
}
.reserva-hint a {
  color: var(--color-accent-on-light);
  font-weight: var(--weight-bold);
  text-underline-offset: 3px;
}
.reserva-hint--manage {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--color-border);
}

.reserva-sent {
  margin-bottom: 18px;
  color: var(--color-text-muted);
  font-size: var(--text-body);
  line-height: 1.5;
}
.reserva-sent strong {
  color: var(--color-text);
}

.reserva-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-accent-on-light);
  font: inherit;
  font-weight: var(--weight-bold);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.reserva-link-btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.reserva-code-input {
  font-size: 1.75rem;
  letter-spacing: 0.45em;
  text-align: center;
  font-weight: var(--weight-bold);
}

.reserva-resend {
  margin-top: 10px;
  width: 100%;
}
.reserva-resend[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.reserva-greeting {
  font-size: var(--text-body-lg);
  margin-bottom: 18px;
  line-height: 1.5;
}

/* ---- Feedback global (sucesso/erro) ---- */
.reserva-feedback {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  line-height: 1.5;
}
.reserva-feedback--success {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid rgba(0, 255, 136, 0.35);
}
.reserva-feedback--error {
  background: var(--color-error-bg);
  color: #FF8A8A;
  border: 1px solid rgba(255, 68, 68, 0.4);
}

/* ---- Cards das crianças ---- */
.res-children {
  display: grid;
  gap: 14px;
}

.res-child {
  background: var(--surface-panel-alt);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 18px 16px;
}

/* Estado vazio: cancelou a última reserva */
.res-empty {
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-body);
  line-height: 1.6;
  padding: 8px 4px;
}
.res-empty a {
  color: var(--color-accent-on-light);
  font-weight: var(--weight-bold);
  text-underline-offset: 3px;
}

.res-child__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.res-child__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.2;
}

.res-child__badge {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.res-child__badge--pago {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid rgba(0, 255, 136, 0.35);
}
.res-child__badge--pendente {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid rgba(255, 179, 0, 0.35);
}
.res-child__badge--cancelada {
  background: var(--color-error-bg);
  color: #FF8A8A;
  border: 1px solid rgba(255, 68, 68, 0.4);
}

.res-child__days {
  font-size: var(--text-body);
  color: var(--color-text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}
.res-child__days strong {
  color: var(--color-text);
}

.res-child__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.res-child__actions .btn {
  min-height: 48px; /* alvo de toque confortável */
}

/* Cancelar: ação destrutiva fica textual (não compete com a ação principal) */
.btn--danger-text {
  background: none;
  border: none;
  color: #FF8A8A;
  font-weight: var(--weight-bold);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 10px 6px;
  cursor: pointer;
}
.btn--danger-text:hover {
  color: var(--color-error);
}
.btn--danger-text:focus-visible {
  outline: 3px solid var(--color-error);
  outline-offset: 2px;
  border-radius: 6px;
}

.btn--danger {
  background: var(--color-error);
  color: #fff;
  border: none;
}
.btn--danger:hover {
  background: #E03535;
}
.btn--danger:focus-visible {
  outline: 3px solid #FF8A8A;
  outline-offset: 2px;
}

/* ---- Editor de dias dentro do card ---- */
.res-child__editor {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}
.res-child__editor-hint {
  font-size: var(--text-small);
  color: var(--color-text-muted);
  margin-bottom: 10px;
  line-height: 1.5;
}
.res-child__editor-hint strong {
  color: var(--color-text);
}
.res-child__editor .form-error {
  display: block;
  margin: 6px 0 10px;
}
.res-child__picker {
  margin-bottom: 4px;
}

/* "Voltar" do editor é neutro — o vermelho do .btn--text (remover criança no
   formulário) leria como ação destrutiva aqui. */
.res-child__editor .editor-back-btn {
  color: var(--color-text-muted);
}
.res-child__editor .editor-back-btn:hover {
  color: var(--color-text);
}

/* Checkbox de dia desabilitado quando o limite foi atingido */
.day-checkbox.is-limit input:not(:checked) + span {
  opacity: 0.4;
}

/* Dia com presença já confirmada: fica marcado e fora de alcance. O cadeado é
   o traço (borda + cursor), não um glow — a leitura é "já aconteceu", não erro. */
.day-checkbox.is-locked {
  cursor: not-allowed;
  border-color: var(--color-success);
  background-color: rgba(0, 255, 136, 0.08);
}
.day-checkbox.is-locked:hover {
  border-color: var(--color-success);
}
.day-checkbox.is-locked span {
  opacity: 0.75;
}

/* Aviso de presença confirmada no card (fora do editor) */
.res-child__locked {
  margin-top: 6px;
  font-size: var(--text-small);
  line-height: 1.5;
  color: var(--color-success);
}

/* ---- Modal de confirmação de cancelamento ---- */
.reserva-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 6, 11, 0.78);
}
.reserva-modal__panel {
  width: 100%;
  max-width: 420px;
  background: var(--surface-panel);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  padding: 24px 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.reserva-modal__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.25;
  margin-bottom: 10px;
}
.reserva-modal__text {
  color: var(--color-text-muted);
  font-size: var(--text-body);
  line-height: 1.55;
  margin-bottom: 20px;
}
/* Empilhado de propósito (não por wrap acidental): os labels são frases, e
   lado a lado eles quebrariam dentro do botão. Ação segura em cima. */
.reserva-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.reserva-modal__actions .btn {
  width: 100%;
  min-height: 48px;
}

/* ---- Voltar pro site ---- */
.reserva-back {
  text-align: center;
  margin-top: 22px;
}
.reserva-back a {
  color: var(--color-text-muted);
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  text-decoration: none;
}
.reserva-back a:hover {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---- Entrada suave, respeitando reduced motion ---- */
@media (prefers-reduced-motion: no-preference) {
  .reserva-card,
  .reserva-back {
    animation: reserva-rise 0.5s ease-out both;
  }
  @keyframes reserva-rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

/* ---- Telas maiores ---- */
@media (min-width: 640px) {
  .reserva-card {
    padding: 36px 36px 40px;
  }
  .reserva-header {
    padding-top: 40px;
  }
}
