/**
 * END-JS3 — Endelea unified date input
 * Editable formatted field + calendar icon. Native date input stays rendered
 * so showPicker() can open the calendar.
 */

.ed-date-field {
  width: 100%;
  position: relative;
  min-width: 10.5em;
}

.ed-date-field input.ed-date-display {
  display: block;
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 38px;
  padding: 8px 36px 8px 12px !important;
  font-family: inherit;
  font-size: var(--ed-text-base, 14px);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  line-height: 1.3;
  color: var(--ed-text, #171d26);
  background: var(--ed-white, #fff);
  border: 1px solid var(--ed-border, #c5cdd6);
  border-radius: var(--ed-radius-sm, 6px);
  pointer-events: auto;
  box-sizing: border-box;
}

.ed-date-display::placeholder {
  color: var(--ed-text-subtle, #6b7785);
  letter-spacing: 0.02em;
}

.ed-date-field .ed-date-display:focus,
.ed-date-field .ed-date-display:focus-visible {
  outline: none;
  border-color: var(--ed-navy, #0f1f33);
  box-shadow: 0 0 0 3px rgba(15, 31, 51, 0.08);
}

.ed-date-field .ed-date-display:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ed-date-picker {
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  width: 34px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: calc(var(--ed-radius-sm, 6px) - 1px);
  background: transparent;
  color: var(--ed-text-muted, #5c6b7a);
  cursor: pointer;
  pointer-events: auto;
  box-shadow: none;
}

.ed-date-picker:hover,
.ed-date-picker:focus,
.ed-date-picker:focus-visible {
  color: var(--ed-navy, #0f1f33);
  background: rgba(15, 31, 51, 0.04);
  outline: none;
  box-shadow: none;
}

.ed-date-picker:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ed-date-picker-icon {
  display: block;
}

.ed-date-field.has-error .ed-date-display {
  border-color: var(--ed-danger, #c53030);
}

.ed-date-native,
.ed-date-field input.ed-date-value[type="date"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.ed-date-range {
  display: flex;
  align-items: flex-end;
  gap: 8px 12px;
  max-width: 36em;
}

.ed-date-range > .field,
.ed-date-range > .ep-confirm-label,
.ed-date-range > .ep-date-lbl,
.ed-date-range > .ed-date-field,
.ed-date-range > .js-date-item {
  flex: 1 1 0;
  min-width: 0;
}

.ed-date-range-sep {
  flex: 0 0 auto;
  padding-bottom: 10px;
  color: var(--ed-text-muted, #5c6b7a);
}
