/* Date/Time Styles for Form Inputs */
/* This file contains styles for date and time inputs (excluding birth_date) */

/* Desktop Media Query - Error widths for date/time fields */
@media (min-width: 769px) {
  #time_choice_1_error,
  #time_choice_2_error,
  #time_choice_3_error,
  #date_choice_3_error,
  #date_choice_2_error,
  #date_choice_1_error {
    width: 58%;
  }
}

/* Fix for iOS date input width */
input[type="date"] {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px 18px;
  padding-right: 35px;
  background-color: #fff;
}

/* Show native calendar picker on click */
input[type="date"]::-webkit-calendar-picker-indicator {
  background: transparent;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  cursor: pointer;
  z-index: 1;
}

/* Date/Time Choice Responsive Layout */
.date-time-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.date-time-col {
  flex: 1;
  min-width: 0;
  position: relative;
}

.date-time-col label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.date-time-col input[type="date"],
.date-time-col select {
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
  padding: 10px;
  font-size: 14px;
}

.date-time-col .field-error {
  width: 100% !important;
}

/* Mobile adjustments for date/time rows */
@media (max-width: 768px) {
  .date-time-row {
    flex-direction: row;
    gap: 8px;
  }

  .date-time-col {
    flex: 1;
  }

  .date-time-col label {
    font-size: 12px;
    line-height: 1.3;
    min-height: 32px;
  }

  .date-time-col input[type="date"],
  .date-time-col select {
    padding: 8px 4px;
    font-size: 13px;
  }
}

/* Specific fix for pregnancies_weeks date input */
#pregnancies_weeks {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  font-size: 16px;

  border-radius: 4px;
  background-color: #fff;
  position: relative;
  cursor: pointer;
}

@media (min-width: 769px) {
  #pregnancies_weeks {
    width: calc(48% - 10px);
    max-width: calc(48% - 10px);
  }
}
