/* Field wrapper */
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field + .field {
  margin-top: 16px;
}

/* Labels */
.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  line-height: 1.4;
}

.field-label .required {
  color: var(--danger);
  margin-left: 2px;
}

/* Hint & error */
.field-hint {
  font-size: 12.5px;
  color: var(--gray-400);
  line-height: 1.4;
}

.field-error {
  font-size: 12.5px;
  color: var(--danger);
  line-height: 1.4;
}

/* Text inputs & textarea */
.input,
.textarea {
  display: block;
  width: 100%;
  padding: 8px 11px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--gray-900);
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-md);
  line-height: 1.5;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--gray-300);
}

.input:hover,
.textarea:hover {
  border-color: var(--gray-300);
}

.input:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-light);
}

/* Date picker natif — accent Bazyl (fallback WebKit/Blink) */
input[type="date"]::-webkit-calendar-picker-indicator {
  color: var(--brand-primary);
  cursor: pointer;
  opacity: .6;
}

input[type="date"]::-webkit-datetime-edit-day-field:focus,
input[type="date"]::-webkit-datetime-edit-month-field:focus,
input[type="date"]::-webkit-datetime-edit-year-field:focus {
  background: var(--brand-primary);
  color: white;
  border-radius: 2px;
}

/* ── Flatpickr — thème Bazyl ─────────────────────────────────────────────── */
.flatpickr-calendar {
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  font-family: var(--font);
  border: 1px solid var(--gray-100);
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: white;
}

.flatpickr-day:hover {
  background: var(--brand-primary-light);
  border-color: var(--brand-primary-light);
}

.flatpickr-day.today {
  border-color: var(--brand-primary);
}

.flatpickr-day.today:hover {
  background: var(--brand-primary-light);
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
  fill: var(--brand-primary);
}

.flatpickr-time input:hover,
.flatpickr-time input:focus,
.flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-time .flatpickr-am-pm:focus {
  background: var(--brand-primary-light);
}

.numInputWrapper span:hover {
  background: var(--brand-primary-light);
}

/* L'altInput est readonly mais doit rester cliquable */
.flatpickr-input[readonly] {
  background: white;
  cursor: pointer;
}

.textarea {
  resize: vertical;
  min-height: 80px;
}

/* Error state */
.input--error,
.textarea--error {
  border-color: var(--danger);
}

.input--error:focus,
.textarea--error:focus {
  box-shadow: 0 0 0 3px var(--danger-bg);
}

/* Select */
.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: '';
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--gray-400);
  pointer-events: none;
}

.select {
  display: block;
  width: 100%;
  padding: 8px 32px 8px 11px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--gray-900);
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-md);
  line-height: 1.5;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.select:hover {
  border-color: var(--gray-300);
}

.select:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-light);
}

/* Checkbox */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--gray-300);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: var(--brand-primary);
}

.checkbox-label {
  font-size: 14px;
  color: var(--gray-700);
  cursor: pointer;
  line-height: 1.4;
}

/* Radio */
.radio-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.radio-wrapper input[type="radio"] {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--gray-300);
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: var(--brand-primary);
}

/* Form actions row */
.form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-100);
}

/* Simple Form error list */
#error_explanation {
  background: var(--danger-bg);
  border: 1px solid #fca5a5;
  border-radius: var(--r-md);
  padding: 12px 16px;
  margin-bottom: 20px;
}

#error_explanation h2 {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--danger-text);
  margin-bottom: 6px;
}

#error_explanation ul {
  list-style: disc inside;
  font-size: 13px;
  color: var(--danger-text);
}
