/* WP Bautomo form layout */
.bauform {
  width: 100%;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.bauform.has-half-width-inputs fieldset {
  justify-content: flex-start;
  column-gap: 4%;
  row-gap: 24px;
}

.bauform.has-half-width-inputs fieldset>* {
  box-sizing: border-box;
  width: 48%;
  margin-left: 0;
  margin-right: 0;
}

.bauform.has-full-width-inputs fieldset>* {
  box-sizing: border-box;
  width: 100%;
}

.bauform fieldset[hidden],
.bauform [data-bau-field-identifier][hidden] {
  display: none !important;
}

@media (max-width: 700px) {
  .bauform.has-half-width-inputs fieldset {
    column-gap: 0;
  }

  .bauform.has-half-width-inputs fieldset>* {
    width: 100%;
  }
}

/* Multi-file picker */
.bauform .bau-file-picker {
  display: block;
  margin-top: 8px;
}

.bauform .bau-file-picker-action {
  position: relative;
  display: inline-flex;
  max-width: 100%;
}

.bauform .bau-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.bauform .bau-file-picker-button {
  position: relative;
  display: inline-block;
  padding: 14px;
  border: none;
  border-radius: 4px;
  background: #27a8e0;
  color: #fff;
  font-size: 16px;
  line-height: 1.2;
  transition: 0.1s all ease-in-out;
  cursor: pointer;
}

.bauform .bau-file-picker-action:hover .bau-file-picker-button {
  background: #091030;
}

.bauform .bau-file-picker-action:focus-within .bau-file-picker-button {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.bauform .bau-file-input:disabled+.bau-file-picker-button {
  opacity: 0.65;
  cursor: not-allowed;
}

.bauform .bau-file-help {
  display: block;
  margin-top: 6px;
}

.bauform .bau-file-list {
  display: block;
  margin-top: 10px;
}

.bauform .bau-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  margin-top: 6px;
  border: 1px solid #d6d6d6;
  border-radius: 4px;
  background: #f7f7f7;
}

.bauform .bau-file-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.bauform .bau-file-remove {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}

.bauform.has-half-width-inputs fieldset > .bau-condition-trigger.checkbox {
  width: 100%;
}

.bauform .bau-condition-trigger.checkbox {
  padding: 14px 16px;
  margin-top: 4px;
  margin-bottom: 8px;
  border-radius: 6px;
  background: #f7f7f7;
}

.bauform .bau-condition-trigger.checkbox > label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  line-height: 1.4;
}

.bauform .bau-condition-trigger.checkbox input[type="checkbox"] {
  order: -1;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 0 !important;
  position: static;
}

.bauform .bau-condition-trigger.checkbox .field-label {
  display: inline-block;
  margin: 0;
  line-height: 1.4;
  font-weight: 600;
}

.bauform .bau-condition-trigger + .bau-conditional-target {
  margin-top: 0;
}

/* Conditional targets: pehmeämpi näkyviin/piiloon animaatio */
.bauform .bau-conditional-target {
  overflow: hidden;
  opacity: 1;
  max-height: 2000px;
  transform: translateY(0);
  transition:
    opacity 180ms ease,
    max-height 260ms ease,
    transform 220ms ease,
    margin 220ms ease,
    padding 220ms ease;
}

.bauform .bau-conditional-target.bau-condition-hiding {
  opacity: 0;
  max-height: 0;
  transform: translateY(-6px);
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.bauform .bau-conditional-target.bau-condition-showing {
  opacity: 0;
  transform: translateY(-6px);
}

@media (prefers-reduced-motion: reduce) {
  .bauform .bau-conditional-target {
    transition: none;
  }
}