/**
 * components.css — Design System e Componentes Refinados (Atualizado)
 * Cris Esteticista
 */

/* Container Universal (largura total para fundos alternados, conteúdo centralizado em 1200px) */
.section-container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding-block: 96px;
  padding-inline: max(24px, calc((100% - var(--container-max-width)) / 2 + 24px));
}

@media (max-width: 768px) {
  .section-container {
    padding-block: 64px;
    padding-inline: 20px;
  }
}

/* Cabeçalho de Seção Editorial */
.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 48px auto;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  border-radius: var(--radius-pill);
  background-color: var(--rosa-petala);
  color: var(--texto);
  font-size: var(--font-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 20px;
  border: 1px solid var(--rosa-medio);
  box-shadow: 0 2px 8px rgba(156, 74, 102, 0.08);
}

.section-title {
  font-family: var(--font-heading);
  font-size: var(--font-h2);
  line-height: var(--line-height-heading);
  color: var(--texto);
  margin-bottom: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.section-title em {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 500;
}

.section-description {
  font-size: var(--font-base);
  color: var(--texto);
  opacity: 0.88;
  max-width: var(--max-width-text);
  margin: 0 auto;
  line-height: var(--line-height-body);
}

/* Botões Padronizados */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 14px 30px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease, background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.btn > * {
  position: relative;
  z-index: 2;
}

.btn-sm {
  min-height: 42px;
  padding: 8px 20px;
  font-size: 0.875rem;
}

/* Botão Primário: fundo --rosa-profundo, texto #FFFFFF */
.btn-primary {
  background-color: var(--rosa-profundo);
  color: #FFFFFF;
  border: 1.5px solid var(--rosa-profundo);
  box-shadow: 0 4px 14px rgba(156, 74, 102, 0.18);
}

/* Brilho diagonal do botão primário */
.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.35) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: translateX(-120%) skewX(-20deg);
  pointer-events: none;
  z-index: 1;
}

.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Botão Secundário: contorno --rosa-profundo, texto --texto */
.btn-secondary {
  background-color: transparent;
  color: var(--texto);
  border: 1.5px solid var(--rosa-profundo);
}

/* Preenchimento deslizante de baixo para cima no botão secundário */
.btn-secondary::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: var(--rosa-petala);
  transform: translateY(100%);
  transition: transform 0.35s ease;
  pointer-events: none;
  z-index: -1;
}

/* Keyframe de balanço do ícone no botão primário */
@keyframes iconWiggle {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(-12deg); }
  55% { transform: rotate(10deg); }
  80% { transform: rotate(-6deg); }
  100% { transform: rotate(0deg); }
}

/* Hover apenas para dispositivos com cursor fino (não fica preso em telas de toque) */
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover:not(:disabled) {
    background-color: #90445E; /* Tom 8% mais escuro de --rosa-profundo */
    border-color: #90445E;
    color: #FFFFFF;
    box-shadow: 0 12px 28px -4px rgba(156, 74, 102, 0.35);
  }

  .btn-secondary:hover:not(:disabled) {
    box-shadow: inset 0 0 0 1px var(--rosa-profundo), 0 10px 24px -4px rgba(156, 74, 102, 0.22);
  }
}

/* Foco visível por teclado com destaque equivalente (sem movimento do brilho) */
.btn-primary:focus-visible:not(:disabled) {
  background-color: #90445E;
  border-color: #90445E;
  color: #FFFFFF;
  box-shadow: 0 12px 28px -4px rgba(156, 74, 102, 0.35);
}

.btn-secondary:focus-visible:not(:disabled) {
  box-shadow: inset 0 0 0 1px var(--rosa-profundo), 0 10px 24px -4px rgba(156, 74, 102, 0.22);
}

/* Animações de movimento (apenas quando o usuário não prefere redução de movimento) */
@media (prefers-reduced-motion: no-preference) {
  @media (hover: hover) and (pointer: fine) {
    .btn-primary:hover:not(:disabled),
    .btn-secondary:hover:not(:disabled) {
      transform: translateY(-3px) scale(1.03);
    }

    .btn-primary:hover:not(:disabled)::before {
      transform: translateX(120%) skewX(-20deg);
      transition: transform 0.7s ease;
    }

    .btn-primary:hover:not(:disabled) svg {
      animation: iconWiggle 0.6s ease forwards;
    }

    .btn-secondary:hover:not(:disabled)::before {
      transform: translateY(0);
    }
  }

  .btn-primary:focus-visible:not(:disabled),
  .btn-secondary:focus-visible:not(:disabled) {
    transform: translateY(-3px) scale(1.03);
  }

  .btn-secondary:focus-visible:not(:disabled)::before {
    transform: translateY(0);
  }

  .btn-primary:active:not(:disabled),
  .btn-secondary:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
    transition: transform 0.1s ease;
  }
}

/* Com prefers-reduced-motion: reduce, mantém apenas mudança de cor sem movimento */
@media (prefers-reduced-motion: reduce) {
  .btn-primary::before {
    display: none;
  }

  .btn-secondary::before {
    transform: translateY(0);
    opacity: 0;
  }

  @media (hover: hover) and (pointer: fine) {
    .btn-secondary:hover:not(:disabled)::before {
      opacity: 1;
    }
  }

  .btn-secondary:focus-visible:not(:disabled)::before {
    opacity: 1;
  }
}

/* Cards de Serviço com Toque Spa (Agrupados por Categoria) */
.services-categories {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.service-category-group {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.service-category-heading {
  font-family: var(--font-heading);
  font-size: var(--font-h3);
  font-weight: 600;
  color: var(--texto);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rosa-medio);
  text-wrap: balance;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 28px;
}

.service-card {
  background-color: #FFFFFF;
  border: 1px solid var(--rosa-medio);
  border-radius: var(--radius-card);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  box-shadow: var(--shadow-card);
  position: relative;
}

.service-card--package {
  background-color: var(--creme);
}

.service-category-tag {
  display: inline-block;
  font-size: var(--font-xs);
  color: var(--texto);
  background-color: var(--rosa-petala);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
  font-weight: 600;
  border: 1px solid var(--rosa-medio);
  width: fit-content;
}

.service-card h3,
.service-card h4 {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  color: var(--texto);
  margin-bottom: 10px;
  font-weight: 600;
  text-wrap: balance;
}

.service-meta-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--texto);
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--rosa-medio);
}

.service-desc-text {
  font-size: 0.95rem;
  color: var(--texto);
  opacity: 0.88;
  margin-top: 14px;
  flex-grow: 1;
  line-height: 1.6;
}

/* Layout de Agendamento */
.booking-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 36px;
  align-items: start;
}

@media (max-width: 960px) {
  .booking-layout {
    grid-template-columns: 1fr;
  }
}

.booking-flow {
  background-color: #FFFFFF;
  border: 1px solid var(--rosa-medio);
  border-radius: var(--radius-card);
  padding: 36px;
  box-shadow: var(--shadow-card);
  scroll-margin-top: 96px; /* Desktop: header 80px + 16px */
}

@media (max-width: 768px) {
  .booking-flow {
    scroll-margin-top: 72px; /* Mobile: header 56px + 16px */
  }
}

@media (max-width: 600px) {
  .booking-flow {
    padding: 22px 18px;
  }
}

/* Stepper de 4 Passos */
.stepper-nav {
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rosa-medio);
  scroll-margin-top: 96px; /* Desktop: header 80px + 16px */
}

@media (max-width: 768px) {
  .stepper-nav {
    scroll-margin-top: 72px; /* Mobile: header 56px + 16px */
  }
}

/* Lista de serviços compacta no Passo 1 (2 colunas no desktop, 1 no mobile) */
.services-selection-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 640px) {
  .services-selection-list {
    grid-template-columns: 1fr;
  }
}

.step-panel-title:focus:not(:focus-visible),
.booking-notice-card:focus:not(:focus-visible) {
  outline: none;
}

.booking-notice-card {
  scroll-margin-top: 96px;
}

@media (max-width: 768px) {
  .booking-notice-card {
    scroll-margin-top: 72px;
  }
}

.stepper-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 640px) {
  .stepper-list {
    gap: 6px;
  }
}

.stepper-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--texto);
  opacity: 0.45;
  transition: opacity 0.2s;
  text-align: center;
}

.stepper-item.active {
  opacity: 1;
  font-weight: 600;
}

.stepper-item.completed {
  opacity: 0.85;
  cursor: pointer;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--rosa-profundo);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.stepper-item.active .step-num {
  background-color: var(--rosa-profundo);
  color: #FFFFFF;
  border-color: var(--rosa-profundo);
}

.stepper-item.completed .step-num {
  background-color: var(--rosa-medio);
  color: var(--texto);
  border-color: var(--rosa-medio);
}

/* Painéis de Conteúdo do Fluxo */
.booking-step-panel {
  display: none;
}

.booking-step-panel.active {
  display: block;
  animation: fadeInStep 0.35s ease forwards;
}

@keyframes fadeInStep {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-panel-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  margin-bottom: 8px;
  color: var(--texto);
  font-weight: 600;
  text-wrap: balance;
}

.step-panel-hint {
  font-size: 0.9rem;
  color: var(--texto);
  opacity: 0.8;
  margin-bottom: 24px;
}

.step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--rosa-medio);
}

@media (max-width: 600px) {
  .step-actions {
    flex-direction: column-reverse;
  }
  .step-actions .btn {
    width: 100%;
  }
}

/* ============================================================================
   Calendário Compacto — Passo 2 do Agendamento
   ============================================================================ */

#step-panel-2 .step-panel-title {
  margin-bottom: 4px;
}

#step-panel-2 .step-panel-hint {
  margin-bottom: 14px;
}

#step-panel-2 .step-actions {
  margin-top: 20px;
  padding-top: 16px;
}

.calendar-wrapper {
  width: 100%;
  max-width: 420px;
  margin-inline: auto;
}

@media (max-width: 600px) {
  .calendar-wrapper {
    max-width: 100%;
  }
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.calendar-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--texto);
  line-height: 1.2;
  text-align: center;
}

.cal-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--rosa-medio);
  background-color: #FFFFFF;
  color: var(--texto);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* Expande alvo de toque para 40px mantendo o círculo visual de 36px */
.cal-nav-btn::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
}

@media (hover: hover) and (pointer: fine) {
  .cal-nav-btn:hover:not(:disabled) {
    background-color: var(--rosa-petala);
    border-color: var(--rosa-profundo);
  }
}

.cal-nav-btn:disabled,
.cal-nav-btn[aria-disabled="true"] {
  border-color: transparent;
  background-color: transparent;
  color: rgba(58, 35, 48, 0.35);
  color: color-mix(in srgb, var(--texto) 35%, transparent);
  cursor: default;
}

.cal-nav-btn:focus-visible {
  outline: 2px solid var(--rosa-profundo);
  outline-offset: 2px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  justify-items: center;
  align-items: center;
  text-align: center;
}

.cal-weekday {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(58, 35, 48, 0.7);
  color: color-mix(in srgb, var(--texto) 70%, transparent);
}

.cal-day-empty {
  width: 44px;
  height: 44px;
  pointer-events: none;
}

.cal-day-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--rosa-medio);
  background-color: #FFFFFF;
  color: var(--texto);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .cal-day-btn:hover:not(:disabled):not(.is-selected) {
    background-color: var(--rosa-petala);
  }
}

.cal-day-btn:disabled,
.cal-day-btn[aria-disabled="true"],
.cal-day-btn.is-unavailable {
  border-color: transparent;
  background-color: transparent;
  color: rgba(58, 35, 48, 0.35);
  color: color-mix(in srgb, var(--texto) 35%, transparent);
  cursor: default;
}

.cal-day-btn.is-selected {
  background-color: var(--rosa-profundo);
  border-color: var(--rosa-profundo);
  color: #FFFFFF;
  font-weight: 700;
}

/* Indicador discreto de Hoje sem alterar o tamanho da célula */
.cal-day-btn.is-today::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--rosa-profundo);
}

.cal-day-btn.is-today.is-selected::after {
  background-color: #FFFFFF;
}

.cal-day-btn.is-today:disabled::after {
  background-color: rgba(58, 35, 48, 0.35);
  background-color: color-mix(in srgb, var(--texto) 35%, transparent);
}

.cal-day-btn:focus-visible {
  outline: 2px solid var(--rosa-profundo);
  outline-offset: 2px;
}

/* Garante ausência de transbordamento em viewports estreitos (360px e 390px) */
@media (max-width: 420px) {
  .booking-section {
    padding-inline: 12px;
  }

  .booking-flow {
    padding: 20px 14px;
  }
}

@media (max-width: 379px) {
  .cal-day-btn,
  .cal-day-empty {
    width: 40px;
    height: 40px;
  }

  .cal-day-btn.is-today::after {
    bottom: 4px;
  }
}

/* Card Resumo Lateral */
.booking-summary-card {
  background-color: var(--rosa-petala);
  border: 1px solid var(--rosa-medio);
  border-radius: var(--radius-card);
  padding: 28px;
  position: sticky;
  top: 96px;
  box-shadow: var(--shadow-card);
}

.summary-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  margin-bottom: 20px;
  color: var(--texto);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rosa-medio);
  font-weight: 600;
  text-wrap: balance;
}

.summary-details {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 0.95rem;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.summary-item dt {
  color: var(--texto);
  opacity: 0.8;
  font-size: 0.875rem;
}

.summary-item dd {
  font-weight: 600;
  text-align: right;
  color: var(--texto);
}

.summary-price {
  font-size: 1.25rem;
  color: var(--rosa-profundo);
  font-weight: 700 !important;
}

.summary-footer-note {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--rosa-medio);
  font-size: 0.8rem;
  opacity: 0.8;
  text-align: center;
}

/* Formulário Passo 4 */
.booking-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--texto);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rosa-medio);
  background-color: var(--creme);
  color: var(--texto);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  background-color: #FFFFFF;
  border-color: var(--rosa-profundo);
  box-shadow: 0 0 0 3px rgba(156, 74, 102, 0.20);
}

.field-error {
  font-size: 0.8rem;
  color: var(--rosa-profundo);
  min-height: 1.2em;
  font-weight: 600;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--texto);
  opacity: 0.75;
}

.booking-notice-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background-color: var(--creme);
  border: 1px solid var(--rosa-medio);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--texto);
  line-height: 1.5;
}

.booking-notice-card svg {
  flex-shrink: 0;
  color: var(--rosa-profundo);
  margin-top: 2px;
}
