/* Reset i podstawowe style */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #1d1d1d;
  color: #ffffff;
  margin: 0;
  padding: 20px;
  line-height: 1.5;
}

/* Centrowanie formularza */
#edk-form, #success-message {
  max-width: 800px;
  margin: 20px auto;
}

h1 {
  text-align: center;
  color: #e53935;
  font-weight: 600;
}

h2 {
  color: #e53935;
  margin-top: 0;
  font-weight: 500;
}

label {
  display: block;
  margin-top: 20px;
  font-weight: bold;
  font-size: 0.95em;
  color: #f0f0f0;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  border: 1px solid #555;
  border-radius: 6px;
  background-color: #424242;
  color: #ffffff;
  font-size: 1rem;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

input:disabled, textarea:disabled, select:disabled {
  background-color: #333;
  color: #888;
  cursor: not-allowed;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #e53935;
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.4);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

.checkbox-group {
  margin-top: 25px;
}

.checkbox-group label {
  font-weight: normal;
  display: flex;
  align-items: center;
  margin-top: 15px;
  font-size: 0.9em;
}

.checkbox-group input[type="checkbox"] {
  margin-right: 12px;
  width: auto;
  flex-shrink: 0;
}

.checkbox-group .select-all {
  margin-bottom: 10px;
  font-weight: bold;
}

button {
  margin-top: 30px;
  width: 100%;
  background-color: #e53935;
  color: white;
  border: none;
  padding: 15px;
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

button:hover:not(:disabled) {
  background-color: #c62828;
  transform: translateY(-2px);
}

button:disabled {
  background-color: #888;
  cursor: not-allowed;
}

/* Przycisk "Nie znaleziono?" */
button.secondary {
  background-color: #555;
  font-size: 0.9rem;
  padding: 10px;
  margin-top: 15px;
}

button.secondary:hover:not(:disabled) {
  background-color: #777;
}

.hidden {
  display: none;
}

/* Style dla pól telefonu */
.phone-wrapper {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}

.iti {
  width: auto !important;
  flex-shrink: 0;
}

.iti__flag-container {
  background-color: #424242 !important;
  border: none !important;
  border-radius: 6px !important;
}

.iti__selected-flag {
  background-color: #424242 !important;
  color: #fff !important;
  border: none !important;
  padding: 8px;
  border-radius: 6px !important;
}

.iti__country-list {
  background-color: #2c2c2c !important;
  color: white !important;
  border: 1px solid #555 !important;
  max-height: 200px !important;
  overflow-y: auto !important;
  z-index: 9999 !important;
}

.iti__country {
  padding: 8px 10px !important;
  background-color: #2c2c2c !important;
  color: #fff !important;
}

.iti__country:hover,
.iti__country.highlight {
  background-color: #3c3c3c !important;
}

.phone-wrapper input[type="tel"] {
  background-color: #424242;
  color: white;
  padding: 10px;
}

/* Nowy styl dla weryfikacji email */
.email-verify-group {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.email-verify-group > div {
  flex: 1;
}

.email-verify-group button {
  margin-top: 0;
  padding: 12px 15px;
  width: auto;
  flex-shrink: 0;
  font-size: 1rem;
}

.inline-group > div.email-field {
  flex-grow: 1;
}

.inline-group > div.button-field {
  flex-grow: 0;
  min-width: 150px;
}

.email-status {
  margin-top: 10px;
  font-size: 0.9em;
  padding: 8px 10px;
  border-radius: 4px;
}

.status-error {
  background-color: #c62828;
}

.status-success {
  background-color: #4CAF50;
}

/* Responsywność */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  
  .form-section {
    padding: 20px 15px;
  }
  
  h1 {
    font-size: 1.5em;
    line-height: 1.3;
  }
  
  h2 {
    font-size: 1.3em;
  }
  
  /* Wszystkie inline grupy jeden pod drugim */
  .inline-group {
    flex-direction: column !important;
    gap: 0 !important;
  }
  
  .inline-group > div {
    width: 100% !important;
    min-width: 100% !important;
  }
  
  .email-verify-group {
    flex-direction: column;
    align-items: stretch;
  }
  
  .email-verify-group button {
    width: 100%;
  }
  
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  textarea,
  select {
    font-size: 16px; 
    width: 100% !important;
  }
  
  /* Checkboxy - lepsze formatowanie */
  .checkbox-group label {
    font-size: 14px;
    line-height: 1.5;
    margin-top: 12px;
  }
  
  /* Buttony pełna szerokość */
  button {
    font-size: 18px;
    padding: 16px;
  }
  
  /* Select2 - lepsze wyświetlanie */
  .select2-container {
    font-size: 16px !important;
  }
  
  .select2-container--default .select2-selection--single {
    height: 50px !important;
    padding: 10px 0 !important;
  }
  
  .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 50px !important;
  }
  
  /* Telefon - stack vertically */
  .phone-wrapper {
    flex-direction: column;
    gap: 10px;
  }
  
  .iti {
    width: 100% !important;
  }
  
  #phone, #phone_returning {
    width: 100% !important;
    padding-left: 12px;
  }
  
  /* Modal dostosowany do małych ekranów */
  .modal-content {
    margin: 20px;
    max-width: calc(100% - 40px);
    padding: 25px 20px;
  }
}

/* Dodatkowe media query dla bardzo małych ekranów */
@media (max-width: 480px) {
  body {
    padding: 5px;
  }
  
  .form-section {
    padding: 15px 10px;
    margin-bottom: 20px;
  }
  
  h1 {
    font-size: 1.3em;
  }
  
  h2 {
    font-size: 1.1em;
  }
  
  label {
    font-size: 14px;
  }
  
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  textarea,
  select {
    font-size: 16px;
    padding: 10px;
  }
  
  button {
    font-size: 16px;
    padding: 14px;
  }
}

.section-image {
  display: block;
  margin: 30px auto;
  max-width: 400px;
  width: 100%;
  height: auto;
}

/* Lepsze odstępy i padding dla sekcji */
.form-section {
  background-color: #2c2c2c;
  padding: 30px;
  margin-bottom: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border-left: 5px solid #e53935;
}

/* Zoptymalizowane grupowanie pól */
.inline-group {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.inline-group > div {
  flex: 1;
  min-width: 250px;
}

/* Style dla modali */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: #2c2c2c;
  padding: 20px;
  border-radius: 10px;
  color: #ffffff;
  max-width: 500px;
  width: 100%;
  text-align: center;
}

/* intl-tel-input poprawki */
.phone-wrapper {
  position: relative;
}

#phone {
  padding-left: 50px;
}

#phone_returning {
  padding-left: 50px;
}

.info-box {
  line-height: 1.6;
  color: #fff;
  background-color: #2c2c2c;
  padding: 20px;
  border-radius: 10px;
  list-style-position: inside;
  text-align: center;
  margin: 0 auto 30px auto;
  max-width: 700px;
}

/* --- STYLE DLA SELECT2 (FLAGI KRAJÓW) --- */
.img-flag {
  width: 20px;
  height: 15px; 
  margin-right: 8px;
  vertical-align: middle;
  border: 1px solid #555;
}

.select2-container--default .select2-selection--single {
  background-color: #424242;
  border: 1px solid #555;
  border-radius: 6px;
  height: 47px; 
  padding: 8px 0;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #ffffff;
  line-height: 28px;
  padding-left: 12px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: #fff transparent transparent transparent;
  margin-top: 4px;
}

.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default .select2-selection--single:focus {
  border-color: #e53935;
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.4);
  outline: none;
}

.select2-dropdown {
  background-color: #2c2c2c;
  border: 1px solid #555;
  border-radius: 6px;
  color: white;
}

.select2-search--dropdown .select2-search__field {
  background-color: #424242;
  border: 1px solid #555;
  color: white;
  border-radius: 6px;
}

.select2-results__option {
  background-color: #2c2c2c;
  color: white;
}

.select2-results__option--highlighted {
  background-color: #3c3c3c !important;
}

.select2-results__option[aria-selected=true] {
  background-color: #555 !important;
}

#krajBlock select.select2-hidden-accessible {
  display: none;
}

/* --- NOWY STYL DLA KOMUNIKATU SUKCESU --- */
#success-message {
  background-color: #2c2c2c;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border-left: 5px solid #4CAF50;
  text-align: center;
}

#success-message h2 {
  color: #4CAF50;
}

#submitted-email {
  color: #e53935;
  font-weight: bold;
  word-break: break-all;
}
