/* Base input styles */
.akkomq-input {
  width: 100%;
}

.akkomq-input textarea,
.akkomq-input input[type="text"],
.akkomq-input input[type="email"],
.akkomq-input input[type="tel"],
.akkomq-input input[type="number"],
.akkomq-input input[type="password"],
.akkomq-input input[type="url"] {
  border: 1px solid rgba(4, 28, 100, 0.15);
  border-radius: 8px;
  background: var(--wp--preset--color--white);
  color: var(--wp--preset--color--deep-blue);
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.akkomq-input textarea {
  padding: 0.75rem 1rem;
  min-height: 100px;
  resize: vertical;
}

.akkomq-input input[type="text"],
.akkomq-input input[type="email"],
.akkomq-input input[type="tel"],
.akkomq-input input[type="number"],
.akkomq-input input[type="password"],
.akkomq-input input[type="url"] {
  padding: 0.75rem 1rem;
  height: 44px;
}

.akkomq-input textarea:focus,
.akkomq-input input[type="text"]:focus,
.akkomq-input input[type="email"]:focus,
.akkomq-input input[type="tel"]:focus,
.akkomq-input input[type="number"]:focus,
.akkomq-input input[type="password"]:focus,
.akkomq-input input[type="url"]:focus {
  outline: none;
  border-color: var(--wp--preset--color--primary-blue);
  box-shadow: 0 0 0 3px rgba(4, 28, 100, 0.1);
}

.akkomq-input textarea::placeholder,
.akkomq-input input[type="text"]::placeholder,
.akkomq-input input[type="email"]::placeholder,
.akkomq-input input[type="tel"]::placeholder,
.akkomq-input input[type="number"]::placeholder,
.akkomq-input input[type="password"]::placeholder,
.akkomq-input input[type="url"]::placeholder {
  color: rgba(4, 28, 100, 0.5);
}

.akkomq-input-group.akkomq-input-radio-buttons {
  margin-bottom: 0;
}

.akkomq-input-radio-buttons fieldset {
  border: none;
  outline: none;
  margin-inline: 0;
  padding-inline: 0;
  padding-bottom: 0;
}

.akkomq-input-radio-buttons legend {
  font-size: 0.85rem;
}

.akkomq-input-radio-buttons-button-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.akkomq-input-radio-buttons-single-input {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.akkomq-input-group-with-background {
  background: rgba(4, 28, 100, 0.02);
  border-radius: 8px;
  border: 1px solid rgba(4, 28, 100, 0.1);
  padding: 10px;
  padding-top: 16px;
  margin-bottom: 1.25rem;
}

/* Input group */
.akkomq-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.akkomq-input-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--wp--preset--color--primary-blue);
  margin-bottom: 0;
  display: block;
}

.akkomq-input-group .field-error {
  color: #dc2626;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Style pour les messages d'erreur */
.field-error {
  display: block;
  color: #dc2626;
  font-size: 0.8rem;
}

/* Checkbox styling */
.akkomq-input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border: 2px solid var(--wp--preset--color--primary-blue);
  border-radius: 4px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  position: relative;
  padding: 0;
  accent-color: var(--wp--preset--color--primary-blue);
}

.akkomq-input[type="checkbox"]:checked {
  background-color: var(--wp--preset--color--primary-blue);
}

.akkomq-input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  color: white;
  font-size: 12px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(4, 28, 100, 0.02);
  border-radius: 8px;
  border: 1px solid rgba(4, 28, 100, 0.1);
}

.checkbox-wrapper label {
  margin-bottom: 0;
  font-size: 0.85rem;
}

/* Submit button styling */
.btn-akkomq-submit {
  position: relative;
  height: 44px;
  overflow: hidden;
  padding: 0.75rem 1.5rem;
  background: var(--wp--preset--color--primary-blue);
  color: var(--wp--preset--color--white);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 1rem;
  width: 100%;
}

.btn-akkomq-submit:hover {
  background: var(--wp--preset--color--deep-blue);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(4, 28, 100, 0.2);
}

.btn-akkomq-submit:active {
  transform: translateY(0);
}

/* Select2 styling */
.select2-container--default .select2-selection--single {
  display: flex;
  height: 44px;
  padding: 0.75rem 1rem;
  align-items: center;
  gap: 12px;
  align-self: stretch;
  border-radius: 8px;
  border: 1px solid rgba(4, 28, 100, 0.15);
  background: var(--wp--preset--color--white);
  transition: all 0.2s ease;
  min-height: 44px;
  height: auto;
}

.select2-container--default.select2-container--focus
  .select2-selection--multiple {
  border-color: var(--wp--preset--color--primary-blue);
}

.select2-container--default .select2-selection--single:focus-within {
  border-color: var(--wp--preset--color--primary-blue);
  box-shadow: 0 0 0 3px rgba(4, 28, 100, 0.1);
}

.select2-container--default
  .select2-selection--single
  .select2-selection__rendered {
  color: var(--wp--preset--color--primary-blue);
  padding: 0;
  line-height: 1.2;
  min-height: 20px;
  white-space: normal;
  word-break: break-word;
  font-size: 0.9rem;
}

.select2-container--default
  .select2-selection--single
  .select2-selection__placeholder {
  color: rgba(4, 28, 100, 0.5);
}

.select2-container--default
  .select2-selection--single
  .select2-selection__arrow {
  top: 50%;
  transform: translateY(-50%);
}

.select2-dropdown {
  border: 1px solid rgba(4, 28, 100, 0.15);
  border-radius: 8px;
  margin-top: 4px;
  background: var(--wp--preset--color--white);
  box-shadow: 0 4px 20px rgba(4, 28, 100, 0.1);
}

.select2-container--default .select2-results__option {
  padding: 0.75rem 1rem !important;
  color: var(--wp--preset--color--primary-blue);
  transition: all 0.2s ease;
  white-space: normal;
  word-break: break-word;
  line-height: 1.2;
  font-size: 0.9rem;
}

.select2-container--default
  .select2-results__option--highlighted[aria-selected] {
  background: var(--wp--preset--color--soft-white);
  color: var(--wp--preset--color--primary-blue);
}

.select2-container--default .select2-results__option[aria-selected="true"] {
  background: rgba(4, 28, 100, 0.1);
}

/* Multiple select */
.select2-container--default .select2-selection--multiple {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(4, 28, 100, 0.15);
  background: var(--wp--preset--color--white);
  transition: all 0.2s ease;
}

.select2-container--default
  .select2-selection--multiple
  .select2-selection__choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--wp--preset--color--soft-white);
  border: 1px solid rgba(4, 28, 100, 0.1);
  border-radius: 150px;
  padding: 0.25rem 0.75rem;
  margin: 0.25rem;
  color: var(--wp--preset--color--primary-blue);
  font-size: 0.8rem;
}

.select2-container--default
  .select2-selection--multiple
  .select2-selection__choice__remove {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  color: var(--wp--preset--color--primary-blue);
  opacity: 0.5;
  cursor: pointer;
  transition: all 0.2s ease;
}

.select2-selection__choice__remove {
  top: auto !important;
  left: 8px !important;
}

.select2-selection__choice__display {
  padding-left: 12px !important;
}

.select2-container--default
  .select2-selection--multiple
  .select2-selection__choice__remove:hover {
  opacity: 1;
  background: none;
}

/* Signature Input Styling - Redesigned */
.akkomq-input-signature {
  width: 100%;
}

.akkomq-input-signature .signature-container {
  position: relative;
  border: 1px solid rgba(4, 28, 100, 0.15);
  border-radius: 8px;
  background: var(--wp--preset--color--white);
  transition: all 0.2s ease;
}

.akkomq-input-signature .signature-container:focus-within {
  border-color: var(--wp--preset--color--primary-blue);
  box-shadow: 0 0 0 3px rgba(4, 28, 100, 0.1);
}

/* Mode signature existante */
.akkomq-input-signature .existing-signature {
  padding: 1rem;
  text-align: center;
}

.akkomq-input-signature .signature-display {
  max-width: 100%;
  max-height: 120px;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

/* Mode dessin */
.akkomq-input-signature .signature-draw {
  position: relative;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.akkomq-input-signature .signature-canvas {
  width: 100%;
  height: 100%;
  background: var(--wp--preset--color--white);
  border-radius: 8px;
  cursor: crosshair;
}

.akkomq-input-signature .signature-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(4, 28, 100, 0.5);
  font-size: 0.9rem;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.akkomq-input-signature .signature-placeholder .dashicons {
  font-size: 1.2rem;
  width: 1.2rem;
  height: 1.2rem;
}

/* Mode upload */
.akkomq-input-signature .signature-upload {
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  border: 2px dashed rgba(4, 28, 100, 0.15);
  border-radius: 8px;
  margin: 1rem;
  transition: all 0.2s ease;
}

.akkomq-input-signature .signature-upload:hover {
  border-color: var(--wp--preset--color--primary-blue);
  background: rgba(4, 28, 100, 0.02);
}

.akkomq-input-signature .upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: rgba(4, 28, 100, 0.7);
}

.akkomq-input-signature .upload-content .dashicons {
  font-size: 1.5rem;
  width: 1.5rem;
  height: 1.5rem;
}

/* Actions */
.akkomq-input-signature .signature-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid rgba(4, 28, 100, 0.1);
  background: rgba(4, 28, 100, 0.02);
}

.akkomq-input-signature .signature-btn {
  padding: 0.5rem 0.75rem;
  background: var(--wp--preset--color--white);
  border: 1px solid rgba(4, 28, 100, 0.15);
  border-radius: 6px;
  color: var(--wp--preset--color--primary-blue);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.akkomq-input-signature .signature-btn:hover {
  background: var(--wp--preset--color--primary-blue);
  color: var(--wp--preset--color--white);
  border-color: var(--wp--preset--color--primary-blue);
}

.akkomq-input-signature .signature-btn.btn-cancel {
  background: var(--wp--preset--color--white);
  border-color: #dc2626;
  color: #dc2626;
}

.akkomq-input-signature .signature-btn.btn-cancel:hover {
  background: #dc2626;
  color: var(--wp--preset--color--white);
  border-color: #dc2626;
}

/* File input caché */
.akkomq-input-signature .signature-file-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* akkomq-input-image */
.akkomq-input-image {
  width: 100%;
  max-width: 595px;
}

.akkomq-input-image .image-input-wrapper {
  position: relative;
  margin-bottom: 10px;
}

.akkomq-input-image .image-preview {
  width: 100%;
  height: 100px;
  border: 1px solid #ccc;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Background blanc seulement quand il n'y a pas d'image */
.akkomq-input-image .image-preview:not(.has-image) {
  background-color: #fff;
}

.akkomq-input-image .image-preview.has-image {
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: transparent;
}

.akkomq-input-image .image-preview input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.akkomq-input-image .upload-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.9);
  z-index: 1;
}

.akkomq-input-image .has-image .upload-overlay {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.akkomq-input-image .has-image:hover .upload-overlay {
  opacity: 1;
}

/* akkomq-input-file */
.akkomq-input-file {
  width: 100%;
}

.akkomq-input-file[data-allow-delete="false"] label {
  user-select: none;
  pointer-events: none;
}

.akkomq-input-file .file-input-wrapper {
  width: 100%;
}

/* Upload Container */
.akkomq-input-file .upload-container {
  position: relative;
  width: 100%;
}

.akkomq-input-file .upload-container input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.akkomq-input-file .upload-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  border: 2px dashed #e5e7eb;
  border-radius: 0.5rem;
  background-color: #f9fafb;
  cursor: pointer;
  transition: all 0.2s ease;
}

.akkomq-input-file .upload-overlay:hover,
.akkomq-input-file .upload-overlay.dragover {
  border-color: var(--wp--preset--color--primary-blue);
  background-color: #f3f4f6;
}

.akkomq-input-file .upload-overlay svg {
  width: 2.5rem;
  height: 2.5rem;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.akkomq-input-file .upload-overlay svg path {
  fill: #9ca3af;
}

.akkomq-input-file .upload-overlay .upload-text {
  color: #6b7280;
  font-size: 0.875rem;
}

/* Current File Display */
.akkomq-input-file .current-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  margin-top: 0.5rem;
}

.akkomq-input-file .current-file .file-name {
  color: #374151;
  font-size: 0.875rem;
  font-weight: 500;
  margin-right: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.akkomq-input-file .current-file .file-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.akkomq-input-file .current-file .file-actions button,
.akkomq-input-file .current-file .file-actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.375rem;
  border: none;
  background: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.akkomq-input-file .current-file .file-actions .download-file {
  color: var(--wp--preset--color--primary-blue);
}

.akkomq-input-file .current-file .file-actions .download-file:hover {
  background-color: var(--wp--preset--color--primary-blue-50);
}

.akkomq-input-file .current-file .file-actions .download-file svg {
  width: 1.25rem;
  height: 1.25rem;
  font-size: 1.25rem;
}

.akkomq-input-file .current-file .file-actions .remove-file svg {
  width: 1.25rem;
  height: 1.25rem;
  font-size: 1.25rem;
}

.akkomq-input-file .current-file .file-actions .remove-file svg path {
  fill: #ef4444;
}

.akkomq-input-file .current-file .file-actions .remove-file:hover {
  background-color: #fee2e2;
}

.akkomq-input-file .current-file .file-actions .dashicons {
  width: 1.25rem;
  height: 1.25rem;
  font-size: 1.25rem;
}

.btn-submit-signature-documents {
  width: 100%;
}

.select2-results {
  z-index: 10000;
}

/* Cacher le select original jusqu'à ce que Select2 soit initialisé */
.select-2-single {
  visibility: hidden;
}

/* Une fois que Select2 est initialisé, il crée un conteneur avec la classe .select2-container */
.select2-container .select-2-single {
  visibility: visible;
}

dialog .select2-dropdown.select2-dropdown--below {
  margin-top: 0px;
  margin-left: -3px;
}

/* akkomq-multiple-date */
.akkomq-multiple-date-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.akkomq-date-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.akkomq-date-row .date-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.akkomq-date-row .date-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(4, 28, 100, 0.15);
  border-radius: 8px;
  background-color: var(--wp--preset--color--white);
  color: var(--wp--preset--color--primary-blue);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.akkomq-date-row .date-input:focus {
  outline: none;
  border-color: var(--wp--preset--color--primary-blue);
  box-shadow: 0 0 0 3px rgba(4, 28, 100, 0.1);
}

.date-input {
  width: 100%;
}

.akkomq-date-row .remove-date {
  padding: 0.5rem;
  background: none;
  border: 1px solid rgba(4, 28, 100, 0.15);
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  color: var(--wp--preset--color--primary-blue);
  transition: all 0.2s ease;
}

.akkomq-date-row .remove-date:hover {
  background: rgba(4, 28, 100, 0.05);
}

.btn-add-date {
  position: relative;
  overflow: hidden;
  padding: 0.75rem 1.5rem;
  background: var(--wp--preset--color--primary-blue);
  color: var(--wp--preset--color--white);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  font-weight: 600;
}

.btn-add-date:hover {
  background: rgba(4, 28, 100, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(4, 28, 100, 0.2);
}

.btn-add-date:active {
  transform: translateY(0);
}

.btn-add-date:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.vc {
  z-index: 10000;
}

/* key-value-select styling */
.key-value-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.key-value-row .key-select {
  flex: 1;
  height: 44px;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(4, 28, 100, 0.15);
  border-radius: 8px;
  background: var(--wp--preset--color--white);
  color: var(--wp--preset--color--primary-blue);
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.key-value-row .value-input {
  flex: 1;
  height: 44px;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(4, 28, 100, 0.15);
  border-radius: 8px;
  background: var(--wp--preset--color--white);
  color: var(--wp--preset--color--primary-blue);
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.key-value-row .key-select:focus,
.key-value-row .value-input:focus {
  outline: none;
  border-color: var(--wp--preset--color--primary-blue);
  box-shadow: 0 0 0 3px rgba(4, 28, 100, 0.1);
}

.key-value-row .remove-key-value {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: 1px solid rgba(4, 28, 100, 0.15);
  border-radius: 6px;
  color: var(--wp--preset--color--primary-blue);
  cursor: pointer;
  transition: all 0.2s ease;
}

.key-value-row .remove-key-value:hover {
  background: rgba(4, 28, 100, 0.05);
}

.akkomq-key-value-container .add-key-value {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  margin-top: 8px;
  padding: 0.75rem 1rem;
  background: var(--wp--preset--color--white);
  border: 1px dashed rgba(4, 28, 100, 0.15);
  border-radius: 8px;
  color: var(--wp--preset--color--primary-blue);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.akkomq-key-value-container .add-key-value:hover {
  background: rgba(4, 28, 100, 0.05);
}

.akkomq-key-value-container .add-key-value .dashicons {
  font-size: 18px;
  width: 18px;
  height: 18px;
}

/* Multiple Pro Place styling */
.akkomq-multiple-pro-place-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.akkomq-multiple-pro-place-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.akkomq-multiple-pro-place-row {
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(4, 28, 100, 0.15);
  border-radius: 8px;
  background: var(--wp--preset--color--white);
}

.akkomq-multiple-pro-place-row .akkomq-pro-place-sub-input {
  flex: 1;
}

.btn-akkomq-remove-pro-place {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 16px;
  background: none;
  border: 1px solid rgba(220, 53, 69, 0.5);
  border-radius: 8px;
  color: #dc3545;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-akkomq-remove-pro-place:hover {
  background: rgba(220, 53, 69, 0.05);
  border-color: #dc3545;
}

.btn-akkomq-add-pro-place {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  padding: 0 16px;
  background: var(--wp--preset--color--white);
  border: 1px dashed rgba(4, 28, 100, 0.15);
  border-radius: 8px;
  color: var(--wp--preset--color--primary-blue);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-akkomq-add-pro-place:hover {
  background: rgba(4, 28, 100, 0.05);
}
