/**
 * Style dla formularza wyszukiwania ofert pracy
 */

.fjo-job-search-form {
  margin: 0 auto;
  padding: 20px;
  background: #fff;
  border-radius: 0;
}

.fjo-form-title {
  margin: 0 0 20px 0;
  font-size: 24px;
  font-weight: 600;
  color: #333;
  text-align: center;
}

.fjo-form-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 30px;
}

/* Kroki formularza */
.fjo-step {
  transition: max-height 0.35s ease, opacity 0.3s ease, margin 0.3s ease;
}
.fjo-step-active {
  opacity: 1;
}
.fjo-step-hidden {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin: 0;
}

.fjo-steps-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.fjo-next-btn {
  background: #51e938;
  color: #000000;
  border: none;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 0;
  cursor: not-allowed;
  opacity: 0.5;
  transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.1s ease;
}

/* Hard overrides against theme resets */
.fjo-job-search-form .fjo-next-btn,
.fjo-job-search-form .fjo-submit-btn,
.fjo-job-search-form .fjo-back-btn {
  color: #000000;
  border-radius: 0;
  border: none;
  background: #51e938;
  text-decoration: none;
}

.fjo-job-search-form .fjo-next-btn:hover:disabled,
.fjo-job-search-form .fjo-next-btn:focus:disabled,
.fjo-job-search-form .fjo-next-btn:active:disabled {
  background: #51e938;
  color: #000000;
  text-decoration: none;
}

.fjo-job-search-form .fjo-next-btn:hover:not(:disabled),
.fjo-job-search-form .fjo-next-btn:focus:not(:disabled),
.fjo-job-search-form .fjo-next-btn:active:not(:disabled) {
  background: #ffffff;
  color: #000000;
  text-decoration: none;
}

.fjo-job-search-form .fjo-submit-btn:hover,
.fjo-job-search-form .fjo-submit-btn:focus,
.fjo-job-search-form .fjo-submit-btn:active:not(:disabled) {
  background: #ffffff;
  color: #000000;
  text-decoration: none;
}
.fjo-job-search-form .fjo-back-btn:hover,
.fjo-job-search-form .fjo-back-btn:focus,
.fjo-job-search-form .fjo-back-btn:active:not(:disabled) {
  background: #ffffff;
  color: #000000;
  text-decoration: none;
}

.fjo-next-btn:not(:disabled) {
  cursor: pointer;
  opacity: 1;
}

.fjo-next-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.fjo-contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.fjo-field-full {
  grid-column: 1 / -1;
}
.fjo-field label {
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
}
.fjo-field input[type="text"],
.fjo-field input[type="email"],
.fjo-field input[type="tel"],
.fjo-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 0;
  font-size: 14px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.fjo-field input[type="text"]:focus,
.fjo-field input[type="email"]:focus,
.fjo-field input[type="tel"]:focus,
.fjo-field textarea:focus {
  outline: none;
  border-color: #3ee522;
  box-shadow: 0 0 0 2px rgba(62, 229, 34, 0.15);
}

/* Style dla błędów walidacji pól */
.fjo-field input[type="text"].error,
.fjo-field input[type="email"].error,
.fjo-field input[type="tel"].error,
.fjo-field textarea.error {
  border-color: #51e938;
  box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1);
}

.fjo-field.error label {
  color: #51e938;
}

@media (max-width: 768px) {
  .fjo-contact-grid {
    grid-template-columns: 1fr;
  }
}

/* Dropzone */
.fjo-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 0;
  padding: 16px;
  text-align: center;
  background: #f8fafc;
}
.fjo-dropzone:hover {
  background: #f1f5f9;
}

.fjo-dropzone.dragover {
  background: #f0fff0;
  border-color: #3ee522;
  border-style: solid;
}

.fjo-dropzone.error {
  border-color: #dc3545;
  background: #fff5f5;
}
.fjo-dropzone input[type="file"] {
  display: none;
}
.fjo-dropzone-instructions {
  color: #475569;
  font-size: 14px;
}
.fjo-dropzone-filename {
  margin-top: 8px;
  font-size: 13px;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.fjo-remove-file-btn {
  background: #51e938;
  color: white;
  border: none;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 0;
  cursor: pointer;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}

.fjo-remove-file-btn:hover {
  background: #51e938;
}

/* Responsywność dla całego formularza */
@media (max-width: 768px) {
  .fjo-form-fields {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .fjo-job-search-form {
    padding: 16px;
  }

  .fjo-form-title {
    font-size: 20px;
  }
}

.fjo-form-field {
  display: flex;
  flex-direction: column;
}

/* Search input w każdym polu */
.fjo-search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd !important;
  border-radius: 0 !important;
  font-size: 14px;
  margin-bottom: 12px;
  transition: border-color 0.3s ease;
  position: relative;
}

.fjo-search-input:focus {
  outline: none;
  border-color: #3ee522 !important;
}

.fjo-search-input::placeholder {
  color: #999;
  font-style: italic;
}

/* Ikona wyszukiwania w inputach */
.fjo-search-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
  padding-right: 40px;
}

.fjo-search-input:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%233ee522' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
}

/* Ikona X do czyszczenia - pokazuje się gdy jest tekst */
.fjo-search-input.has-text {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E");
  cursor: pointer;
}

.fjo-search-input.has-text:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23007cba' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E");
}

.fjo-form-field label {
  margin-bottom: 8px;
  font-weight: 500;
  color: #000000;
  font-size: 16px;
}

/* Checkbox groups */
.fjo-checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
  padding: 16px;
  border: 1px solid #ddd;
  border-radius: 0;
  background: #fff;
  height: 300px;
  overflow-y: auto;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Responsywność dla checkbox groups */
@media (max-width: 768px) {
  .fjo-checkbox-group {
    grid-template-columns: 1fr;
    height: 250px;
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .fjo-checkbox-group {
    height: 200px;
    padding: 8px;
    gap: 6px;
  }
}

/* Checkbox labels */
.fjo-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 0;
  cursor: pointer;
  background: #fff;
  border: 1px solid #e1e5e9;
}

.fjo-checkbox-label:hover {
  background: #f8f9fa;
}

.fjo-checkbox-label:has(.fjo-checkbox:checked) {
  background: #edfff0;
  border-color: #3ee522;
}

.fjo-checkbox-label:has(.fjo-checkbox:focus) {
  background: #f0fff8;
  border-color: #3ee522;
}

/* Custom checkboxes */
.fjo-checkbox {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #ddd;
  border-radius: 0;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

/* Animacja dla ukrywania/pokazywania elementów */
.fjo-checkbox-label {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.fjo-checkbox-label[style*="display: none"] {
  opacity: 0;
  transform: scale(0.95);
}

.fjo-checkbox:checked {
  background: #51e938;
  border-color: #51e938;
}

.fjo-checkbox:checked::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: bold;
}

.fjo-checkbox:focus {
  outline: none;
}

/* Checkbox text */
.checkbox-text {
  font-size: 14px;
  color: #333;
  font-weight: 500;
  user-select: none;
}

.fjo-checkbox-label:hover .checkbox-text {
  color: #000000;
}

/* Placeholder dla pustych grup checkboxów */
.no-options {
  text-align: center;
  padding: 20px;
  color: #999;
  font-style: italic;
  background: #f8f9fa;
  border-radius: 0;
  border: 2px dashed #ddd;
}

.fjo-form-submit {
  text-align: center;
  margin-top: 30px;
}

.fjo-step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 30px;
  gap: 20px;
  width: 100%;
}

.fjo-step-actions .fjo-form-submit {
  margin-top: 0;
  text-align: right;
}

.fjo-back-btn {
  background: #6c757d;
  color: #fff;
  border: none;
  padding: 16px 30px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 0;
  cursor: pointer;
  transition: background-color 0.3s ease;
  flex-shrink: 0;
}

.fjo-back-btn:hover {
  background: #5a6268;
}

.fjo-submit-btn {
  background: #51e938;
  color: #000000;
  border: none;
  padding: 16px 30px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 0;
  cursor: pointer;
  transition: background-color 0.2s ease;
  min-width: 200px;
}

/* Zgoda RODO */
.fjo-consent {
  margin: 10px 0 20px 0;
  border: 1px solid #e1e5e9;
  background: #fff;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease, margin 0.3s ease;
}

.fjo-consent-hidden {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  margin-bottom: 0;
}

.fjo-consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  cursor: pointer;
}

.fjo-consent-label input[type="checkbox"] {
  margin-top: 3px;
}

/* Ujednolicenie RODO checkbox do stylu multiselect */
.fjo-consent .fjo-consent-label {
  border: 1px solid #e1e5e9;
  border-radius: 0px;
  background: #fff;
}

.fjo-consent .fjo-consent-label .fjo-checkbox {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #ddd;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.fjo-consent .fjo-consent-label:has(.fjo-checkbox:hover) {
  background: #f8f9fa;
}

.fjo-consent .fjo-consent-label:has(.fjo-checkbox:checked) {
  background: #edfff0;
  border-color: #3ee522;
}

.fjo-consent .fjo-consent-label:has(.fjo-checkbox:focus) {
  background: #f0fff8;
  border-color: #3ee522;
}

.fjo-consent .fjo-consent-label .fjo-checkbox:checked {
  background: #51e938;
  border-color: #51e938;
}

.fjo-consent .fjo-consent-label .fjo-checkbox:checked::after {
  content: "\2713";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: bold;
}

.fjo-consent-text {
  font-size: 13px;
  color: #333;
  line-height: 1.45;
}

.fjo-submit-btn:hover {
  background: #ffffff;
}

/* Clipped-corner variant for buttons */
.fjo-submit-btn.clipped-corner,
.fjo-next-btn.clipped-corner,
.fjo-back-btn.clipped-corner {
  position: relative;
  z-index: 1;
  border: unset;
  --fjo-cta-corner: 1em;
  --fjo-cta-notch: 0.5em;
  --fjo-cta-border: 2px;
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - var(--fjo-cta-corner)),
    calc(100% - var(--fjo-cta-notch)) calc(100% - var(--fjo-cta-notch)),
    calc(100% - var(--fjo-cta-corner)) 100%,
    0 100%
  );
}

.fjo-submit-btn.clipped-corner:hover::before,
.fjo-next-btn.clipped-corner:not(:disabled):hover::before,
.fjo-back-btn.clipped-corner:hover::before {
  border: unset;
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: var(--celuk-primary, #3ee622);
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - 1em),
    calc(100% - 0.5em) calc(100% - 0.5em),
    calc(100% - 1em) 100%,
    0 100%,
    0 0,
    2px 2px,
    2px calc(100% - 2px),
    calc(100% - 1em - 1px) calc(100% - 2px),
    calc(100% - 0.5em - 2px) calc(100% - 0.5em - 1px),
    calc(100% - 2px) calc(100% - 1em - 1px),
    calc(100% - 2px) 2px,
    2px 2px
  );
}

.fjo-submit-btn:active {
  transform: translateY(1px);
}

/* Responsywność */
@media (max-width: 768px) {
  .fjo-job-search-form {
    margin: 10px;
    padding: 15px;
  }

  .fjo-form-fields {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .fjo-form-title {
    font-size: 20px;
  }

  .fjo-submit-btn {
    width: 100%;
    min-width: auto;
  }

  .fjo-step-actions {
    flex-direction: row;
    gap: 15px;
    flex-wrap: wrap;
  }

  .fjo-back-btn {
    flex: 1;
  }

  .fjo-step-actions .fjo-form-submit {
    flex: 1;
    text-align: right;
  }

  .fjo-step-actions .fjo-submit-btn {
    width: 100%;
  }
}

/* Styl dla wybranych opcji */
.fjo-multiselect option:checked {
  background: linear-gradient(135deg, #51e938, #3ee522);
  color: #000000;
  font-weight: 700;
}

/* Style dla etykiet pól */
.fjo-field-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-weight: 600;
  color: #333;
  font-size: 16px;
}

/* Counter wybranych opcji */
.selection-counter {
  background: rgba(80, 233, 56, 0.5);
  color: #000000;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  margin-left: auto;
  min-width: 24px;
  text-align: center;
  display: inline-block;
}

/* Placeholder dla licznika gdy nie ma wyborów */
.selection-counter-placeholder {
  background: #e9ecef;
  color: #6c757d;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  margin-left: auto;
  min-width: 24px;
  text-align: center;
  display: inline-block;
}

/* Wskaźnik wymagania */
.required-indicator {
  color: #dc3545;
  font-weight: bold;
  margin-left: 4px;
  font-size: 16px;
}

/* Styl dla grup z błędem wymagania */
.fjo-checkbox-group.required-error {
  border-color: #dc3545;
  box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1);
}

.fjo-checkbox-group.required-error .fjo-checkbox-label {
  background: #fff5f5;
  border-color: #fecaca;
}

/* Błąd dla zgody RODO */
.fjo-consent.required-error {
  border-color: #dc3545;
  box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1);
}

/* Komunikaty błędów walidacji */
.validation-error {
  background: #f8d7da;
  color: #721c24;
  padding: 12px 16px;
  border: 1px solid #f5c6cb;
  border-radius: 0;
  margin-bottom: 20px;
  font-weight: 500;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading state */
.fjo-form-field.loading {
  position: relative;
  opacity: 0.6;
  pointer-events: none;
}

.fjo-form-field.loading::after {
  content: "Ładowanie...";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 20px;
  border-radius: 0;
  font-size: 14px;
  color: #3ee522;
  z-index: 10;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.fjo-form-field.loading .fjo-multiselect {
  background-color: #f8f9fa;
}
