/**
 * @file
 * Offerte form Dropzone styling.
 */

/* Honeypot field - visually hidden. */
.offerte-hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  overflow: hidden;
}

/* Remove fieldset borders on offerte form. */
.webform-submission-offerte-aanvragen-add-form fieldset {
  border: none;
  padding: 0;
  margin: 0 0 15px 0;
}

.webform-submission-offerte-aanvragen-add-form fieldset legend {
  font-weight: 700;
  font-size: 18px;
  color: var(--dark, #24327e);
  margin-bottom: 10px;
}

/* Bericht label matching fieldset legend style. */
.webform-submission-offerte-aanvragen-add-form .js-form-item-bericht > label {
  font-weight: 700;
  font-size: 18px;
  color: var(--dark, #24327e);
  margin-bottom: 10px;
  display: block;
}

/* Postcode + Plaats inline row. */
.webform-submission-offerte-aanvragen-add-form .offerte-postcode-plaats-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  max-width: 600px;
}

.offerte-postcode-field {
  flex: 0 0 120px;
}

.offerte-land-field {
  flex: 0 0 140px;
  width: 140px;
}

.offerte-land-field select {
  width: 100%;
}

.offerte-plaats-field {
  flex: 1;
}

/* Product + Aantal inline row. */
.webform-submission-offerte-aanvragen-add-form .offerte-product-aantal-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.offerte-product-field {
  flex: 1;
}

.offerte-aantal-field {
  flex: 0 0 130px;
}

.offerte-product-field label,
.offerte-aantal-field label {
  font-weight: 700;
  font-size: 18px;
  color: var(--dark, #24327e);
  margin-bottom: 10px;
  display: block;
}

/* Number input matching theme text input style. */
.webform-submission-offerte-aanvragen-add-form .offerte-aantal-field input[type="number"] {
  background-color: rgb(234, 247, 255);
  padding: 10px;
  border: 1px solid rgb(22, 65, 148);
  border-radius: 0;
  font-size: 16px;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}

/* Hide native number spinners. */
.offerte-aantal-field input[type="number"]::-webkit-inner-spin-button,
.offerte-aantal-field input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
  display: none;
}

.offerte-aantal-field input[type="number"] {
  -moz-appearance: textfield;
  padding-right: 32px;
}

/* Custom spinner buttons. */
.offerte-aantal-field {
  position: relative;
}

.offerte-spinner {
  position: absolute;
  right: 2px;
  width: 24px;
  display: grid;
  grid-template-rows: 1fr 1fr;
  z-index: 2;
}

.offerte-spinner button {
  background: rgb(234, 247, 255);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  min-height: 0;
  min-width: 0;
  width: 100%;
  color: rgb(22, 65, 148);
  font-size: 11px;
  line-height: 1;
}

.offerte-spinner button:hover {
  background: #dceeff;
}

/* Dropzone container. */
.offerte-dropzone {
  border: 1px dashed rgb(22, 65, 148);
  border-radius: 0;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  background-color: rgb(234, 247, 255);
  transition: border-color 0.2s, background-color 0.2s;
  margin-bottom: 20px;
  min-height: 84px;
}

.offerte-dropzone:hover,
.offerte-dropzone.dz-drag-hover {
  border-color: var(--primary, #3c98fc);
  background-color: #dceeff;
}

.offerte-dropzone .dz-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.offerte-dropzone .dz-message-icon {
  font-size: 36px;
  line-height: 1;
}

.offerte-dropzone .dz-message-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--dark, #24327e);
}

.offerte-dropzone .dz-message-hint {
  font-size: 13px;
  color: #666;
}

/* File preview cards. */
.offerte-file-previews {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.offerte-file-card {
  border: 1px solid #dde4ed;
  border-radius: 6px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.offerte-file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.offerte-file-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.offerte-file-name {
  font-weight: 600;
  color: var(--dark, #24327e);
  word-break: break-all;
  flex: 1;
}

.offerte-file-size {
  color: #888;
  font-size: 13px;
  flex-shrink: 0;
}

.offerte-file-remove {
  background: none;
  border: 1px solid #ddd;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
  padding: 0;
}

button.offerte-file-remove:hover,
button.offerte-file-remove:active {
  color: #fff;
  background-color: #d32f2f;
  border-color: #d32f2f;
}

/* Toggle row (below specs). */
.offerte-toggle-row {
  margin-top: 14px;
  margin-bottom: 0;
  padding-top: 12px;
  border-top: 1px solid #eee;
}

.offerte-toggle-row label.offerte-toggle-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  line-height: 1.4;
}

.offerte-toggle-row label.offerte-toggle-label .offerte-toggle-slider {
  margin-top: 2px;
}

.offerte-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.offerte-toggle-slider {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  background-color: #ccc;
  border-radius: 12px;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.offerte-toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background-color: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.offerte-toggle-input:checked + .offerte-toggle-slider {
  background-color: var(--primary, #3c98fc);
}

.offerte-toggle-input:checked + .offerte-toggle-slider::after {
  transform: translateX(20px);
}

.offerte-toggle-text {
  font-size: 13px;
  color: #555;
}

/* Spec fields. */
.offerte-file-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  transition: opacity 0.2s;
}

.offerte-file-specs.specs-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.offerte-spec-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.offerte-spec-field label {
  font-size: 13px;
  font-weight: 600;
  color: #555;
}

.offerte-spec-select,
.offerte-spec-other-input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  background-color: #fff;
}

.offerte-spec-select:focus,
.offerte-spec-other-input:focus {
  outline: none;
  border-color: var(--primary, #3c98fc);
  box-shadow: 0 0 0 2px rgba(60, 152, 252, 0.15);
}

.offerte-spec-other-input {
  margin-top: 6px;
}

/* Error messages. */
.offerte-file-error {
  padding: 10px 14px;
  background-color: #fff3f3;
  border: 1px solid #f5c6c6;
  border-radius: 6px;
  color: #c62828;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeIn 0.3s;
}

.offerte-file-error .error-icon {
  font-size: 18px;
}

/* External links section. */
.offerte-external-links-section {
  margin: 10px 0 20px;
  padding: 0;
  background: none;
  border: none;
}

.offerte-external-links-section h4 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  font-style: normal;
  font-family: inherit;
  color: var(--dark, #24327e);
}

.offerte-external-links-section .description {
  font-size: 13px;
  color: #666;
  margin: 0 0 12px;
}

/* Animations. */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Submit button right-aligned. */
.webform-submission-offerte-aanvragen-add-form .form-actions {
  text-align: right;
}

/* Two-column grid layout on desktop. */
.offerte-form-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 30px;
  align-items: start;
}

/* Responsive. */
@media (max-width: 767px) {
  .offerte-form-columns {
    grid-template-columns: 1fr;
  }

  .offerte-file-specs {
    grid-template-columns: 1fr;
  }

  .webform-submission-offerte-aanvragen-add-form .offerte-postcode-plaats-row,
  .webform-submission-offerte-aanvragen-add-form .offerte-product-aantal-row {
    flex-direction: column;
    gap: 0;
  }

  .offerte-postcode-field,
  .offerte-land-field,
  .offerte-plaats-field,
  .offerte-product-field,
  .offerte-aantal-field {
    flex: 1 1 100%;
    width: 100%;
  }

  .offerte-dropzone {
    padding: 30px 15px;
  }
}

/* Confirmation thumbs-up image. */
.offerte-thumbs-up {
  text-align: center;
  margin-top: 30px;
  margin-bottom: 0;
  padding-bottom: 0;
  max-height: 550px;
  overflow: hidden;
}

.offerte-thumbs-up img {
  max-height: 600px;
  width: auto;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Remove all bottom spacing between image and footer. */
body:has(.offerte-thumbs-up) .webform-submission-offerte-aanvragen-add-form,
body:has(.offerte-thumbs-up) .webform-confirmation__message,
body:has(.offerte-thumbs-up) .webform-confirmation,
body:has(.offerte-thumbs-up) .main-wrapper,
body:has(.offerte-thumbs-up) .footer-wrapper {
  margin-bottom: 0;
  padding-bottom: 0;
  margin-top: 0;
  padding-top: 0;
}

@media (max-width: 767px) {
  .offerte-thumbs-up img {
    max-height: 300px;
  }
}
