.form-template-content.foreto-form-template {
  margin: 0 auto;
}

.foreto-form-template .form-template-feature-img-wrap {
  width: 100%;
  position: relative;
  aspect-ratio: 21/9;
  overflow: hidden;
}

.foreto-form-template .form-template-feature-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.foreto-form-template .form-template-content-wrap {
  padding: 16px;
}

.foreto-form-template .foreto-form-template-header {
  margin-bottom: 32px;
  text-align: center;
}

.foreto-form-template .foreto-form-template-desc p {
  margin: 0 0 12px 0;
  color: #333;
  font-size: 14px;
  line-height: 1.6;
  font-weight: 600;
  text-align: center;
}

.foreto-form-template .foreto-form-template-desc .foreto-form-text-accent {
  color: #007cba;
  font-size: 16px;
}

.foreto-form-template .foreto-form-template-desc p:last-child {
  margin-bottom: 0;
}

/* Struktura formularza */
.foreto-form-template .row {
  display: flex;
  flex-wrap: wrap;
}

.foreto-form-template .col {
  padding: 0 12px;
  margin-bottom: 20px;
}

.foreto-form-template .col--50 {
  flex: 0 0 50%;
  max-width: 50%;
}

.foreto-form-template .col--100 {
  flex: 0 0 100%;
  max-width: 100%;
}

.foreto-form-template .col--button {
  margin-bottom: 0;
}

/* Pola formularza */
.foreto-form-template .wpcf7-form p {
  margin: 0;
}

.foreto-form-template .wpcf7-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.foreto-form-template .wpcf7-form-control {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 16px;
  line-height: 1.5;
  background: #fff;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.foreto-form-template .wpcf7-form-control:focus {
  outline: none;
  border-color: #007cba;
  box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.foreto-form-template .wpcf7-form-control.wpcf7-textarea {
  min-height: 50px;
  resize: vertical;
}

.foreto-form-template .wpcf7-form-control.wpcf7-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;
  appearance: none;
}

/* Przycisk wysyłania */
.foreto-form-template .wpcf7-form button[type="submit"] {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.foreto-form-template .wpcf7-form button[type="submit"]:hover {
  background: linear-gradient(135deg, #005a87 0%, #004466 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 124, 186, 0.4);
}

.foreto-form-template .wpcf7-form button[type="submit"]:active {
  transform: translateY(0);
}

/* Checkboxy */
.foreto-form-template .terms {
  background: #f8f9fa;
  padding: 12px;
}

.foreto-form-template .terms p {
  margin: 0 0 16px 0;
  color: #333;
  font-size: 14px;
  line-height: 1.5;
}

.foreto-form-template .terms ul {
  margin: 0 0 20px 0;
  padding-left: 20px;
}

.foreto-form-template .terms li {
  margin-bottom: 8px;
  color: #555;
  font-size: 14px;
  line-height: 1.5;
}

.foreto-form-template .checkboxx {
  margin: 16px 0 0 0;
}

.foreto-form-template .wpcf7-acceptance {
  display: block;
}

.foreto-form-template .wpcf7-acceptance .wpcf7-list-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
}

.foreto-form-template .wpcf7-acceptance .wpcf7-list-item label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  margin: 0;
  width: 100%;
  position: relative;
}

/* Ukrycie oryginalnego checkboxa */
.foreto-form-template .wpcf7-acceptance input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

/* Custom checkbox */
.foreto-form-template .wpcf7-acceptance .wpcf7-list-item-label::before {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  border: 2px solid #e1e5e9;
  border-radius: 3px;
  background: #fff;
  flex-shrink: 0;
  transition: all 0.3s ease;
  position: absolute;
  left: 0;
  top: 0;
}

/* Checkbox checked state */
.foreto-form-template
  .wpcf7-acceptance
  input[type="checkbox"]:checked
  + .wpcf7-list-item-label::before {
  background: #007cba;
  border-color: #007cba;
}

/* Checkmark */
.foreto-form-template
  .wpcf7-acceptance
  input[type="checkbox"]:checked
  + .wpcf7-list-item-label::after {
  content: "✓";
  position: absolute;
  left: 3px;
  top: 0;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  line-height: 16px;
}

.foreto-form-template .wpcf7-acceptance .wpcf7-list-item-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: #333;
  flex: 1;
  margin: 0;
  position: relative;
  padding-left: 24px;
}

.foreto-form-template .wpcf7-acceptance .t {
  flex: 1;
  margin: 0;
}

/* Ukrycie domyślnych elementów CF7 */
.foreto-form-template .wpcf7-acceptance .in,
.foreto-form-template .wpcf7-acceptance .in-in {
  display: none;
}

/* ReCAPTCHA */
.foreto-form-template .catpcha {
  text-align: center;
  margin: 20px 0;
}

/* Responsywność */
@media (max-width: 768px) {
  .foreto-form-template .form-template-content-wrap {
    padding: 12px;
  }

  .foreto-form-template .col--50 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .foreto-form-template .col {
    padding: 0;
    margin-bottom: 16px;
  }
}

@media (max-width: 480px) {
  .foreto-form-template .form-template-content-wrap {
    padding: 20px;
  }

  .foreto-form-template .wpcf7-form-control {
    padding: 12px 14px;
    font-size: 16px; /* Zapobiega zoom na iOS */
  }

  .foreto-form-template .wpcf7-form button[type="submit"] {
    padding: 14px 20px;
    font-size: 15px;
  }
}

/* Stany błędów */
.foreto-form-template .wpcf7-form-control.wpcf7-not-valid {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.foreto-form-template .wpcf7-not-valid-tip {
  color: #dc3545;
  font-size: 12px;
  margin-top: 4px;
  display: block;
}

/* Animacje */
.foreto-form-template .wpcf7-form-control {
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
