.ehf-form .ehf-invalid {
  border-color: #ef4444;
}
.ehf-form-message.ehf-error {
  color: #dc2626;
}
.ehf-form-message.ehf-success {
  color: #16a34a;
}
.ehf-hidden-field {
  display: none !important;
}
h3.ehf-form-title {
  text-align: center;
}
/* Form container styling */
.ehf-form {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  border-radius: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

/* Field styling */
.ehf-field {
  margin-bottom: 20px;
}

.ehf-field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
  color: #333;
  line-height: 1.4;
}

.ehf-field input,
.ehf-field textarea,
.ehf-field select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ccc;
  border-radius: 0px;
  font-size: 16px;
  line-height: 1.5;
  color: #374151;
  background-color: #ffffff;
  -webkit-transition: border-color 0.15s ease-in-out,
    -webkit-box-shadow 0.15s ease-in-out;
  transition: border-color 0.15s ease-in-out,
    -webkit-box-shadow 0.15s ease-in-out;
  -o-transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out,
    -webkit-box-shadow 0.15s ease-in-out;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

.ehf-field input:focus,
.ehf-field textarea:focus,
.ehf-field select:focus {
  outline: none;
  border-color: #6366f1;
  -webkit-box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.ehf-field input::-webkit-input-placeholder,
.ehf-field textarea::-webkit-input-placeholder {
  color: #9ca3af;
  opacity: 1;
}

.ehf-field input::-moz-placeholder,
.ehf-field textarea::-moz-placeholder {
  color: #9ca3af;
  opacity: 1;
}

.ehf-field input:-ms-input-placeholder,
.ehf-field textarea:-ms-input-placeholder {
  color: #9ca3af;
  opacity: 1;
}

.ehf-field input::-ms-input-placeholder,
.ehf-field textarea::-ms-input-placeholder {
  color: #9ca3af;
  opacity: 1;
}

.ehf-field input::placeholder,
.ehf-field textarea::placeholder {
  color: #9ca3af;
  opacity: 1;
}

/* Two column layout */
.ehf-two-column-row {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.ehf-two-column-row .ehf-field {
  -webkit-box-flex: 1;
  -ms-flex: 1;
  flex: 1;
  margin-bottom: 0;
}

/* Submit button styling */
.ehf-submit {
  width: 100%;
  padding: 14px 24px;
  background-color: #6366f1;
  color: white;
  border: none;
  border-radius: 0;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  -webkit-transition: background-color 0.15s ease-in-out,
    -webkit-transform 0.15s ease-in-out;
  transition: background-color 0.15s ease-in-out,
    -webkit-transform 0.15s ease-in-out;
  -o-transition: background-color 0.15s ease-in-out, transform 0.15s ease-in-out;
  transition: background-color 0.15s ease-in-out, transform 0.15s ease-in-out;
  transition: background-color 0.15s ease-in-out, transform 0.15s ease-in-out,
    -webkit-transform 0.15s ease-in-out;
  margin-top: 10px;
}

.ehf-submit:hover {
  background-color: #5856eb;
  -webkit-transform: translateY(-1px);
  -ms-transform: translateY(-1px);
  transform: translateY(-1px);
}

.ehf-submit:active {
  -webkit-transform: translateY(0);
  -ms-transform: translateY(0);
  transform: translateY(0);
}

.ehf-submit:disabled {
  background-color: #9ca3af;
  cursor: not-allowed;
  -webkit-transform: none;
  -ms-transform: none;
  transform: none;
}

/* Textarea specific styling */
.ehf-field textarea {
  min-height: 100px;
  resize: vertical;
}

/* Select dropdown styling */
.ehf-field select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 40px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Checkbox and radio styling */
.ehf-checkbox-group,
.ehf-radio-group {
  margin-bottom: 20px;
}

.ehf-checkbox-group legend,
.ehf-radio-group legend {
  font-weight: 600;
  font-size: 14px;
  color: #333;
  margin-bottom: 12px;
  padding: 0;
  border: none;
}

.ehf-checkbox-group > div,
.ehf-radio-group > div {
  margin-bottom: 8px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}

.ehf-checkbox-group input[type="checkbox"],
.ehf-checkbox-group input[type="radio"],
.ehf-radio-group input[type="checkbox"],
.ehf-radio-group input[type="radio"] {
  width: auto;
  margin-right: 8px;
  margin-bottom: 0;
}

.ehf-checkbox-group label,
.ehf-radio-group label {
  margin-bottom: 0;
  font-weight: normal;
  cursor: pointer;
}

/* Single checkbox styling */
.ehf-field-single-checkbox {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: start;
  -ms-flex-align: start;
  align-items: flex-start;
  gap: 8px;
}

.ehf-field-single-checkbox input[type="checkbox"] {
  width: auto;
  margin: 0;
  margin-top: 2px;
}

.ehf-field-single-checkbox label {
  margin-bottom: 0;
  font-weight: normal;
  cursor: pointer;
  -webkit-box-flex: 1;
  -ms-flex: 1;
  flex: 1;
}

/* Help text styling */
.ehf-help {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
}

/* Error states */
.ehf-field input.ehf-invalid,
.ehf-field textarea.ehf-invalid,
.ehf-field select.ehf-invalid {
  border-color: #ef4444;
  -webkit-box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Message styling */
.ehf-form-message {
  padding: 12px 16px;
  border-radius: 0;
  margin-bottom: 20px;
  font-weight: 500;
}

.ehf-form-message.ehf-error {
  background-color: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.ehf-form-message.ehf-success {
  color: #000;
}

/* Responsive design */
@media (max-width: 768px) {
  .ehf-form {
    padding: 16px;
    margin: 0 16px;
  }

  .ehf-two-column-row {
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    gap: 0;
  }

  .ehf-two-column-row .ehf-field {
    margin-bottom: 20px;
  }

  .ehf-field input,
  .ehf-field textarea,
  .ehf-field select {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .ehf-form {
    padding: 12px;
    margin: 0 8px;
  }
}

.ehf-loader {
  border: 4px solid #f3f3f3; /* Jasnoszary */
  border-top: 4px solid #3498db; /* Niebieski */
  border-radius: 50%;
  width: 24px;
  height: 24px;
  -webkit-animation: ehf-spin 1s linear infinite;
  animation: ehf-spin 1s linear infinite;
  display: inline-block;
}

@-webkit-keyframes ehf-spin {
  0% {
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}

@keyframes ehf-spin {
  0% {
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}
