/* ============================================================================
   Campo de data — digitação, calendário e rodas de rolagem
   ----------------------------------------------------------------------------
   A altura dos itens da roda (40px) é combinada com o JS: é ela que faz a linha
   escolhida parar debaixo do marcador. Mudar aqui pede mudar lá.
   ========================================================================== */

.dp-field {
  position: relative;
  display: block;
}

.dp-field .sig-input {
  padding-right: 2.75rem;
}

.dp-trigger {
  position: absolute;
  right: .25rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .5rem;
  border: none;
  border-radius: .5rem;
  background: none;
  color: #660EBA;
  cursor: pointer;
}

.dp-trigger:hover {
  background: #f3f0ff;
}

.dp-trigger:focus-visible {
  outline: 2px solid #660EBA;
  outline-offset: 1px;
}

/* O `display` das duas variações vence o atributo `hidden` da folha de estilo do
   navegador. Sem esta regra, o painel fechado continua ocupando a tela — invisível
   e engolindo os cliques. */
.dp-panel[hidden] {
  display: none;
}

/* ── Calendário ─────────────────────────────────────────── */

.dp-calendar {
  position: absolute;
  z-index: 40;
  top: calc(100% + .375rem);
  left: 0;
  width: min(20rem, calc(100vw - 2rem));
  padding: .75rem;
  border: 1px solid #ece7f6;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 12px 32px rgba(23, 12, 43, .16);
}

.dp-head {
  display: flex;
  align-items: center;
  gap: .375rem;
  margin-bottom: .625rem;
}

.dp-nav {
  flex: none;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  line-height: 1;
  color: #660EBA;
  background: none;
  border: 1px solid #ece7f6;
  border-radius: .625rem;
  cursor: pointer;
}

.dp-nav:hover {
  background: #f3f0ff;
}

.dp-select {
  flex: 1 1 auto;
  min-width: 0;
  height: 2rem;
  padding: 0 .5rem;
  font-size: .8125rem;
  font-weight: 600;
  color: #170C2B;
  background: #faf8ff;
  border: 1px solid #ece7f6;
  border-radius: .625rem;
  cursor: pointer;
}

.dp-weekdays,
.dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: .125rem;
}

.dp-weekdays {
  margin-bottom: .25rem;
}

.dp-weekdays span {
  text-align: center;
  font-size: .6875rem;
  font-weight: 600;
  color: #8a83a0;
}

.dp-day {
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8125rem;
  color: #170C2B;
  background: none;
  border: none;
  border-radius: .625rem;
  cursor: pointer;
}

.dp-day:hover:not(:disabled) {
  background: #f3f0ff;
}

.dp-day:disabled {
  color: #cfcada;
  cursor: default;
}

.dp-day.is-selected {
  background: #660EBA;
  color: #fff;
  font-weight: 600;
}

/* ── Rodas de rolagem ───────────────────────────────────── */

.dp-sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.dp-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 12, 43, .45);
}

.dp-sheet-box {
  position: relative;
  width: 100%;
  max-width: 32rem;
  padding-bottom: env(safe-area-inset-bottom);
  background: #fff;
  border-radius: 1.25rem 1.25rem 0 0;
  box-shadow: 0 -8px 32px rgba(23, 12, 43, .2);
}

.dp-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid #f1eef8;
}

.dp-sheet-title {
  font-size: .875rem;
  font-weight: 600;
  color: #170C2B;
}

.dp-sheet-action {
  padding: .375rem .5rem;
  font-size: .875rem;
  font-weight: 500;
  color: #6b6480;
  background: none;
  border: none;
  border-radius: .5rem;
  cursor: pointer;
}

.dp-sheet-action.is-primary {
  color: #660EBA;
  font-weight: 700;
}

.dp-wheels {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.2fr;
  gap: .25rem;
  padding: .5rem 1rem 1rem;
}

/* Janela da seleção: fica atrás das rodas e não intercepta o toque. */
.dp-wheel-marker {
  position: absolute;
  left: 1rem;
  right: 1rem;
  top: calc(.5rem + 80px);
  height: 40px;
  border-radius: .625rem;
  background: #f3f0ff;
  pointer-events: none;
}

.dp-wheel {
  position: relative;
  height: 200px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  text-align: center;
}

.dp-wheel::-webkit-scrollbar {
  display: none;
}

.dp-wheel:focus-visible {
  outline: 2px solid #660EBA;
  outline-offset: 2px;
  border-radius: .625rem;
}

.dp-wheel-pad {
  height: 80px;
}

.dp-wheel-item {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  font-size: .9375rem;
  color: #9a94ab;
  transition: color .12s ease, font-weight .12s ease;
}

.dp-wheel-item.is-active {
  color: #170C2B;
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .dp-wheel-item {
    transition: none;
  }
}
