/* ============================================================================
 * CNPA — Cadastro: date picker (popover no desktop, bottom-drawer no mobile).
 * Acompanha registration-inputs.js. Tokens de cnpa-ds.css.
 * ========================================================================== */
.reg-date {
  position: relative;
}
.reg-date > input {
  padding-right: 2.85rem;
}
.reg-date__btn {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: color var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard);
}
.reg-date__btn:hover {
  color: var(--action-primary);
  background: var(--surface-sunken);
}
.reg-date__btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.reg-date__backdrop {
  display: none;
}
.reg-date__panel {
  display: none;
  position: absolute;
  z-index: 55;
  top: calc(100% + 6px);
  left: 0;
  width: 18.5rem;
  padding: var(--space-3);
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}
.reg-date[data-open="true"] .reg-date__panel {
  display: block;
}
.reg-date__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
  color: var(--text-strong);
  font-weight: var(--weight-semibold);
}
.reg-date__nav {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: var(--radius-md);
}
.reg-date__nav:hover {
  background: var(--surface-sunken);
  color: var(--action-primary);
}
.reg-date__title {
  border: none;
  background: transparent;
  font: inherit;
  font-weight: var(--weight-semibold);
  color: var(--text-strong);
  cursor: pointer;
  padding: 2px 10px;
  border-radius: var(--radius-md);
}
.reg-date__title:hover {
  background: var(--surface-sunken);
  color: var(--action-primary);
}
.reg-date__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.reg-date__years {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.reg-date__year {
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  height: 2.6rem;
  font-size: var(--text-sm);
  color: var(--text-body);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard);
}
.reg-date__year:hover {
  background: var(--surface-sunken);
}
.reg-date__year.is-sel {
  background: var(--action-primary);
  color: var(--action-primary-text);
  font-weight: var(--weight-semibold);
}
.reg-date__wd {
  text-align: center;
  font-size: var(--text-2xs, 0.7rem);
  color: var(--text-subtle);
  padding: 2px 0;
  font-weight: var(--weight-semibold);
}
.reg-date__day {
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  height: 2.15rem;
  font-size: var(--text-sm);
  color: var(--text-body);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard);
}
.reg-date__day:hover {
  background: var(--surface-sunken);
}
.reg-date__day.is-sel {
  background: var(--action-primary);
  color: var(--action-primary-text);
  font-weight: var(--weight-semibold);
}

/* Mobile: bottom-drawer (mesmo padrão do select e do modal de termos) */
@media (max-width: 36rem) {
  .reg-date[data-open="true"] .reg-date__backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(0, 0, 0, 0.5);
  }
  .reg-date[data-open="true"] .reg-date__panel {
    position: fixed;
    inset: auto 0 0 0;
    top: auto;
    width: 100%;
    z-index: 61;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: var(--space-4) var(--space-4) var(--space-5);
    animation: reg-sheet-up var(--duration-normal) var(--ease-standard);
  }
  .reg-date__day {
    height: 2.7rem;
    font-size: var(--text-base);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reg-date[data-open="true"] .reg-date__panel {
    animation: none;
  }
}
