/**
 * Contact Form Widget Styles.
 * @package InLightStudios
 */

/* Layout */
.ils-cf {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 100%;
}

/* Form Title */
.ils-cf__title {
  margin: 0 0 24px;
  padding: 0;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
}

.ils-cf__subtitle {
  margin: 0 0 20px;
  font-size: 14px;
  color: #64748b;
  line-height: 1.5;
}

/* Form */
.ils-cf__form {
  width: 100%;
}

/* Fields Grid */
.ils-cf__fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ils-cf__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.ils-cf__row--three {
  grid-template-columns: 1fr 1fr 1fr;
}

.ils-cf-field--full {
  grid-column: 1 / -1;
  margin-top: 4px;
}

/* Field */
.ils-cf-field {
  display: flex;
  flex-direction: column;
}

.ils-cf-field__label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 8px;
}

.ils-cf-field__req {
  color: #ef4444;
  margin-left: 2px;
}

.ils-cf-field__input,
.ils-cf-field__select,
.ils-cf-field__textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: #1e293b;
  background: #ffffff;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
  outline: none;
  font-family: inherit;
}

.ils-cf-field__input,
.ils-cf-field__select {
  height: 48px;
}

.ils-cf-field__select {
  padding-top: 0;
  padding-bottom: 0;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  padding-right: 40px;
  cursor: pointer;
}

.ils-cf-field__input:focus,
.ils-cf-field__select:focus,
.ils-cf-field__textarea:focus {
  border-color: #dc2626;
}

.ils-cf-field__input::placeholder,
.ils-cf-field__textarea::placeholder {
  color: #94a3b8;
}

.ils-cf-field__textarea {
  resize: vertical;
  min-height: 100px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.ils-cf-field__file-info {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 6px;
  line-height: 1.4;
}

.ils-cf-field__input--file {
  padding: 0 16px;
  cursor: pointer;
  height: 48px;
  display: flex;
  align-items: center;
  line-height: normal;
}

.ils-cf-field__input--file::file-selector-button {
  padding: 8px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #f8fafc;
  color: #1e293b;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin-right: 12px;
  font-family: inherit;
  line-height: normal;
}

.ils-cf-field__input--file::file-selector-button:hover {
  background: #f1f5f9;
}

.ils-cf-field__input--file::-webkit-file-upload-button {
  padding: 8px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #f8fafc;
  color: #1e293b;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin-right: 12px;
  font-family: inherit;
  line-height: normal;
}

.ils-cf-field__input--file::-webkit-file-upload-button:hover {
  background: #f1f5f9;
}

/* Validation */
.ils-cf-field--error .ils-cf-field__input,
.ils-cf-field--error .ils-cf-field__select,
.ils-cf-field--error .ils-cf-field__textarea {
  border-color: #ef4444;
}

/* Submit */
.ils-cf__submit {
  display: inline-block;
  margin-top: 24px;
  padding: 12px 32px;
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    opacity 0.2s ease;
  font-family: inherit;
}

.ils-cf__submit:hover {
  background: #b91c1c;
}

.ils-cf__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Messages */
.ils-cf__message {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.5;
}

.ils-cf__message--success {
  background: #f0fdf4;
  color: #166534;
  border-left: 3px solid #22c55e;
}

.ils-cf__message--error {
  background: #fef2f2;
  color: #991b1b;
  border-left: 3px solid #ef4444;
}

/* Loading State */
.ils-cf__form--loading {
  opacity: 0.6;
  pointer-events: none;
}

.ils-cf__submit--loading::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border: 2px solid #ffffff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: ilsCfSpin 0.6s linear infinite;
}

@keyframes ilsCfSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .ils-cf__row,
  .ils-cf__row--three {
    grid-template-columns: 1fr;
  }

  .ils-cf__fields {
    gap: 16px;
  }

  .ils-cf__row {
    gap: 16px;
  }
}
