/* ==========================================================================
   agenda.css — Fluxo "Bora tomar um café?"
   Reaproveita os mesmos tokens visuais do index.php (cores, fontes, .btn).
   ========================================================================== */

:root{
  --bg:         #17110D;
  --bg-soft:    #1F1712;
  --surface:    #241B16;
  --surface-2:  #2C221B;
  --border:     #3A2B22;
  --blue:       #1B2FE0;
  --blue-light: #3E56FF;
  --brown-glow: #B4622C;
  --peach:      #F2B79C;
  --peach-soft: #F8D9C6;
  --cream:      #F7F1E8;
  --text:       #F5EFE6;
  --text-muted: #B8A99B;
  --ink:        #17110D;

  --font-tech:  'Plus Jakarta Sans', system-ui, sans-serif;
  --font-voice: 'Fraunces', Georgia, serif;

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-full: 999px;

  --maxw: 1180px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 36px;
  --space-5: 56px;
  --space-6: 84px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-tech);
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}
body::before{
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(48% 55% at 96% 8%, rgba(27,47,224,0.30), transparent 68%),
    radial-gradient(46% 50% at 2% 92%, rgba(180,98,44,0.26), transparent 68%);
}

img{ max-width: 100%; display: block; }
a{ color: inherit; }

h1{
  font-family: var(--font-voice);
  font-weight: 500;
  line-height: 1.18;
  margin: var(--space-2) 0 0;
  letter-spacing: -0.01em;
  font-size: clamp(24px, 6vw, 30px);
  color: var(--text);
}

.wrap{ max-width: var(--maxw); margin: 0 auto; padding: 0 var(--space-2); }

.eyebrow{
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-tech); font-size: 12px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--peach);
}

:focus-visible{ outline: 2px solid var(--peach); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Botões (base do site + variação usada aqui) ---------- */
.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px; border-radius: var(--radius-full);
  font-family: var(--font-tech); font-size: 14.5px; font-weight: 600;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, opacity .15s ease;
}
.btn:hover{ transform: translateY(-1px); }
.btn-primary{ background: var(--blue); color: var(--cream); }
.btn-primary:hover{ background: var(--blue-light); }
.btn-primary:disabled{ opacity: .45; cursor: not-allowed; transform: none; }
.btn-ghost{ background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover{ border-color: var(--peach); }
.btn-block{ width: 100%; }

/* ---------- Header + barra de progresso ---------- */
.agenda-header{
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; padding: 0 var(--space-2);
  background: rgba(23,17,13,0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.agenda-back{
  width: 38px; height: 38px; border-radius: var(--radius-full);
  border: 1px solid var(--border); background: transparent; color: var(--text);
  display: grid; place-items: center; text-decoration: none; flex-shrink: 0;
  transition: border-color .15s ease;
}
.agenda-back:hover{ border-color: var(--peach); }
.agenda-step-label{
  font-size: 12.5px; font-weight: 700; color: var(--text-muted);
  letter-spacing: .02em;
}
.agenda-header-spacer{ width: 38px; flex-shrink: 0; }

.agenda-progress{
  position: sticky; top: 60px; z-index: 49;
  height: 4px; width: 100%; background: var(--border); overflow: hidden;
}
.agenda-progress-fill{
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--peach), var(--blue-light));
  border-radius: var(--radius-full);
  transition: width .4s ease;
}

/* ---------- Layout geral ---------- */
.agenda-main{ padding: var(--space-4) 0 calc(var(--space-6) + 40px); }
.agenda-wrap{ max-width: 560px; }

.agenda-step{ display: none; }
.agenda-step.is-active{ display: block; animation: agendaStepIn .45s ease; }
@keyframes agendaStepIn{
  from{ opacity: 0; transform: translateY(14px); }
  to{ opacity: 1; transform: translateY(0); }
}

.agenda-card{
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-3) var(--space-4);
  box-shadow: 0 24px 50px -30px rgba(0,0,0,.7);
}
.agenda-card--center{ text-align: center; }
.agenda-card--center h1{ margin-top: var(--space-3); }
.agenda-card--center .agenda-lead{ max-width: 42ch; margin-left: auto; margin-right: auto; }
.agenda-card--center .btn{ margin-top: var(--space-4); }

.agenda-confirm-icon{
  width: 72px; height: 72px; margin: 0 auto; border-radius: 50%;
  background: linear-gradient(155deg, var(--peach), var(--blue-light));
  color: var(--ink); display: grid; place-items: center; font-size: 30px;
  box-shadow: 0 20px 40px -16px rgba(27,47,224,.5);
}

.agenda-lead{ margin-top: var(--space-2); font-size: 15.5px; color: var(--text-muted); }

.agenda-chat{
  display: flex; align-items: flex-end; gap: 10px; margin-top: var(--space-4);
}
.agenda-chat-avatar{
  width: 36px; height: 36px; border-radius: 50%; overflow: hidden;
  border: 2px solid var(--peach); flex-shrink: 0; background: var(--surface-2);
}
.agenda-chat-avatar img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.agenda-chat-bubble{
  background: var(--blue); color: var(--cream);
  padding: 12px 15px; border-radius: var(--radius-md); border-bottom-left-radius: 6px;
  font-family: var(--font-tech); font-size: 14px; line-height: 1.5; max-width: 86%;
}

/* ---------- Campos de formulário ---------- */
.agenda-field{ display: flex; flex-direction: column; gap: 8px; margin-top: var(--space-3); }
.agenda-field label{
  font-family: var(--font-tech); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted);
}
.agenda-input{
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px 16px; color: var(--text); font-family: var(--font-tech); font-size: 15.5px;
  width: 100%; transition: border-color .15s ease;
}
.agenda-input::placeholder{ color: var(--text-muted); }
.agenda-input:focus{ outline: none; border-color: var(--peach); }
.agenda-textarea{ resize: vertical; min-height: 120px; line-height: 1.5; }

.agenda-skip{
  display: inline-block; margin-top: var(--space-2); background: none; border: none;
  color: var(--text-muted); font-family: var(--font-tech); font-size: 13.5px;
  text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px;
  cursor: pointer; padding: 4px 0;
}
.agenda-skip:hover{ color: var(--peach); }

.agenda-consent{
  display: flex; align-items: flex-start; gap: 12px; margin-top: var(--space-3);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px 16px; cursor: pointer; font-size: 14px; color: var(--text); line-height: 1.5;
}
.agenda-consent input{
  width: 20px; height: 20px; margin-top: 1px; accent-color: var(--peach);
  flex-shrink: 0; cursor: pointer;
}
.agenda-consent a{ color: var(--peach); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Opções (forma de conversa / período) ---------- */
.agenda-options{
  margin-top: var(--space-3); display: grid; grid-template-columns: 1fr; gap: 10px;
}
@media (min-width: 480px){
  .agenda-options{ grid-template-columns: 1fr 1fr; }
}
.agenda-option{
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 13px 15px; cursor: pointer; text-align: left; font-family: var(--font-tech);
  transition: border-color .15s ease, background .15s ease;
}
.agenda-option:hover{ border-color: var(--peach); }
.agenda-option-icon{
  width: 40px; height: 40px; border-radius: var(--radius-sm); flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--peach);
  display: grid; place-items: center; font-size: 17px; transition: border-color .15s ease, color .15s ease;
}
.agenda-option-label{ flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; color: var(--text); }
.agenda-option-check{
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid var(--border); color: transparent;
  display: grid; place-items: center; font-size: 12px; transition: all .15s ease;
}
.agenda-option.is-selected{ border-color: var(--peach); background: var(--surface-2); }
.agenda-option.is-selected .agenda-option-icon{ border-color: var(--peach); color: var(--peach); }
.agenda-option.is-selected .agenda-option-check{
  border-color: var(--peach); color: var(--ink); background: var(--peach);
}

/* ---------- Calendário ---------- */
.agenda-calendar{
  margin-top: var(--space-3); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-2);
}
.agenda-calendar-head{
  display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-2);
}
.agenda-calendar-head strong{
  font-family: var(--font-voice); font-style: italic; font-weight: 500;
  font-size: 16.5px; color: var(--peach-soft); text-transform: capitalize;
}
.agenda-cal-nav{
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border);
  background: transparent; color: var(--text); display: grid; place-items: center;
  cursor: pointer; transition: border-color .15s ease;
}
.agenda-cal-nav:hover{ border-color: var(--peach); }
.agenda-cal-nav:disabled{ opacity: .3; cursor: not-allowed; }

.agenda-calendar-weekdays{
  display: grid; grid-template-columns: repeat(7, 1fr);
  text-align: center; font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; padding-bottom: 6px;
}
.agenda-calendar-grid{ display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.agenda-cal-day{
  position: relative; aspect-ratio: 1 / 1; display: grid; place-items: center;
  border-radius: 50%; font-size: 13.5px; font-weight: 500; color: var(--text);
  background: transparent; border: 1px solid transparent; cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.agenda-cal-day:hover{ border-color: var(--peach); }
.agenda-cal-day.is-today{ color: var(--peach); font-weight: 700; }
.agenda-cal-day.is-selected{ background: var(--blue); border-color: var(--blue); color: var(--cream); }
.agenda-cal-day.is-disabled{ color: var(--text-muted); opacity: .3; cursor: not-allowed; pointer-events: none; }
.agenda-cal-day.is-empty{ visibility: hidden; pointer-events: none; }

/* ---------- Horários ---------- */
.agenda-chips{ margin-top: var(--space-3); display: flex; flex-wrap: wrap; gap: 10px; min-height: 44px; }
.agenda-chip{
  padding: 12px 18px; border-radius: var(--radius-full); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-family: var(--font-tech);
  font-size: 14px; font-weight: 600; cursor: pointer; transition: all .15s ease;
}
.agenda-chip:hover{ border-color: var(--peach); }
.agenda-chip.is-selected{ background: var(--blue); border-color: var(--blue); color: var(--cream); }
.agenda-chip.is-disabled{
  opacity: .35; text-decoration: line-through; cursor: not-allowed; pointer-events: none;
  background: var(--surface-2);
}
.agenda-empty{ width: 100%; text-align: center; color: var(--text-muted); font-size: 14px; padding: var(--space-2) 0; }

.agenda-skeleton-row{ display: flex; gap: 10px; flex-wrap: wrap; width: 100%; }
.agenda-skeleton{
  width: 84px; height: 44px; border-radius: var(--radius-full);
  background: var(--surface-2); border: 1px solid var(--border);
  animation: agendaPulse 1.2s ease-in-out infinite;
}
@keyframes agendaPulse{ 0%, 100%{ opacity: .5; } 50%{ opacity: 1; } }

/* ---------- Revisão ---------- */
.agenda-review{ margin-top: var(--space-3); display: flex; flex-direction: column; gap: 10px; }
.agenda-review-row{
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 13px 16px; display: flex; flex-direction: column; gap: 4px;
}
.agenda-review-row .label{
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted);
}
.agenda-review-row .value{ font-size: 15px; font-weight: 600; color: var(--text); }

/* ---------- Barra de ação fixa ---------- */
.agenda-actionbar{
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; gap: 12px; align-items: center;
  padding: var(--space-2); padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom));
  background: rgba(23,17,13,0.9); backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
}
.agenda-actionbar.is-hidden{ display: none; }
#agendaVoltarBtn{ flex: 0 0 auto; }
.agenda-next-btn{ flex: 1; }
#agendaVoltarBtn.is-hidden{ display: none; }

/* ---------- Toasts ---------- */
.agenda-toast-container{
  position: fixed; left: 0; right: 0; bottom: 84px; z-index: 60;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 0 var(--space-2); pointer-events: none;
}
.agenda-toast{
  pointer-events: auto; max-width: 480px; width: 100%;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 13px 16px; font-size: 14px; color: var(--text);
  box-shadow: 0 16px 34px -20px rgba(0,0,0,.7);
  animation: agendaToastIn .25s ease;
  display: flex; align-items: center; gap: 10px;
}
.agenda-toast i{ flex-shrink: 0; }
.agenda-toast--danger{ border-color: #C1503F; }
.agenda-toast--danger i{ color: #E38070; }
.agenda-toast--success{ border-color: var(--blue-light); }
.agenda-toast--success i{ color: var(--peach); }
@keyframes agendaToastIn{
  from{ opacity: 0; transform: translateY(8px); }
  to{ opacity: 1; transform: translateY(0); }
}

/* ---------- Banners de instalar PWA / pedir notificação ---------- */
.pwa-banner{
  display: flex; align-items: flex-start; gap: 12px;
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px; margin: 14px auto
  ;
  animation: agendaStepIn .35s ease;
}
.pwa-banner-icon{
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--peach);
  display: grid; place-items: center; font-size: 19px;
}
.pwa-banner-text{ flex: 1; min-width: 0; }
.pwa-banner-text strong{ display: block; font-size: 14.5px; color: var(--text); margin-bottom: 3px; }
.pwa-banner-text span{ font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.pwa-banner-actions{ display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pwa-banner-actions .btn{ height: 36px; padding: 0 14px; font-size: 13px; }
.pwa-banner-dismiss{
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 18px; line-height: 1; flex-shrink: 0; padding: 2px;
}
.pwa-banner-dismiss:hover{ color: var(--text); }

.pwa-ios-steps{ list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pwa-ios-steps li{ display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-muted); }
.pwa-ios-steps .numero{
  width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--peach); font-size: 11.5px; font-weight: 700; display: grid; place-items: center; flex-shrink: 0;
}
.pwa-ios-steps i{ color: var(--peach); }

/* ---------- Menu inferior (área do cliente, PWA) ---------- */
.bottom-nav{
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; background: rgba(23,17,13,.92); backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav-item{
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 10px 4px 8px; text-decoration: none; color: var(--text-muted);
  transition: color .15s ease;
}
.bottom-nav-item.is-active{ color: var(--peach); }
.bottom-nav-icon{ font-size: 21px; line-height: 1; }
.bottom-nav-label{ font-size: 10.5px; font-weight: 600; font-family: var(--font-tech); }

/* aplique essa classe no <main> (ou no elemento que envolve o conteúdo)
   das páginas que têm o menu inferior fixo, senão ele cobre o final do conteúdo */
.tem-bottom-nav{ padding-bottom: calc(70px + env(safe-area-inset-bottom)); }

/* ---------- Botão flutuante de novo agendamento ---------- */
.fab-novo{
  position: fixed; right: 18px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 55;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(155deg, var(--peach), var(--blue-light));
  color: var(--ink); display: grid; place-items: center; font-size: 24px;
  text-decoration: none; box-shadow: 0 16px 34px -12px rgba(27,47,224,.6);
  transition: transform .15s ease, box-shadow .15s ease;
}
.fab-novo:hover{ transform: translateY(-2px) scale(1.04); box-shadow: 0 20px 40px -12px rgba(27,47,224,.7); }

/* ---------- Casca fixa da área do cliente ----------
   Header e menu inferior (ou barra de ações) ficam fixos porque são
   "irmãos" do conteúdo dentro de uma coluna flex de altura total —
   só o .app-shell-content rola, o resto nunca sai do lugar. */
.app-shell{ height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.app-shell > .agenda-header{ position: static; flex-shrink: 0; }
.app-shell-content{ flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.app-shell > .bottom-nav,
.app-shell > .detalhe-actionbar{ position: static; flex-shrink: 0; }
