/**
 * THEME DEFAULT FORM THEME
 *
 * Contains styling for default Sitevision form fields and buttons.
 */


/* General
---------------------------------------------------------*/

.sv-formFieldRow,
.sv-formField {
  box-sizing: border-box;
}

/* Clearfix */
.sv-formFieldRow:after {
  clear: both;
  content: "";
  display: table;
}

.sv-formField {
  float: left;
  width: 100%;
}


/* Responsive columns
---------------------------------------------------------*/

@media (min-width: 400px) {
  .sv-formField--cols-3,
  .sv-formField--cols-4,
  .sv-formField--cols-6 {
    padding: 0 10px 0 0;
    width: 50%;
  }

  .sv-formField--cols-3:nth-of-type(even),
  .sv-formField--cols-4:nth-of-type(even),
  .sv-formField--cols-6:last-child {
    padding: 0 0 0 10px;
  }

  .sv-formField--cols-4:last-child {
    padding: 0;
    width: 100%;
  }
}

@media (min-width: 600px) {
  .sv-formField--cols-4 {
    padding: 0 7px;
    width: 33.333%;
  }

  .sv-formField--cols-4:first-child {
    padding: 0 13px 0 0;
  }

  .sv-formField--cols-4:last-child {
    padding: 0 0 0 13px;
    width: 33.333%;
  }
}

@media (min-width: 800px) {
  .sv-formField--cols-3 {
    padding: 0 15px 0 0;
    width: 25%;
  }

  .sv-formField--cols-3:nth-child(2) {
    padding: 0 10px 0 5px;
  }

  .sv-formField--cols-3:nth-child(3) {
    padding: 0 5px 0 10px;
  }

  .sv-formField--cols-3:nth-child(4) {
    padding: 0 0 0 15px;
  }
}


/* Buttons
---------------------------------------------------------*/

.sv-defaultFormTheme button,
.sv-defaultFormTheme input[type="button"],
.sv-defaultFormTheme input[type="reset"],
.sv-defaultFormTheme input[type="submit"] {
  cursor: pointer;
}

.sv-defaultFormTheme button[disabled],
.sv-defaultFormTheme input[disabled] {
  cursor: default;
}

.sv-defaultFormTheme input[type="button"],
.sv-defaultFormTheme input[type="reset"],
.sv-defaultFormTheme input[type="submit"] {
  align-items: center;
  appearance: none;
  background-color: var(--env-element-primary-background-color);
  border: 1px solid var(--env-element-primary-background-color);
  border-radius: calc(var(--env-button-border-radius) * 1);
  box-sizing: border-box;
  color: var(--env-element-primary-font-color);
  cursor: pointer;
  display: inline-flex;
  font-family: var(--env-button-font-family);
  font-size: var(--env-font-size-medium);
  font-weight: var(--jor-theme-link-font-weight);
  justify-content: center;
  line-height: 1;
  margin: 0;
  min-height: 2.75em;
  padding: 0 1.3125em;
  text-align: center;
  text-decoration: none;
  touch-action: manipulation;
  user-select: none;
  vertical-align: middle;
  white-space: nowrap;
}

.sv-defaultFormTheme input[type="button"]:focus,
.sv-defaultFormTheme input[type="reset"]:focus,
.sv-defaultFormTheme input[type="submit"]:focus,
.sv-defaultFormTheme input[type="button"]:hover,
.sv-defaultFormTheme input[type="reset"]:hover,
.sv-defaultFormTheme input[type="submit"]:hover {
  background-color: var(--env-element-primary-background-color-dark);
}

.sv-defaultFormTheme input[type="button"]:active,
.sv-defaultFormTheme input[type="reset"]:active,
.sv-defaultFormTheme input[type="submit"]:active {
  background-color: var(--env-element-primary-background-color);
}

.sv-defaultFormTheme input[type="button"]:active,
.sv-defaultFormTheme input[type="button"]:focus,
.sv-defaultFormTheme input[type="button"]:hover,
.sv-defaultFormTheme input[type="reset"]:active,
.sv-defaultFormTheme input[type="reset"]:focus,
.sv-defaultFormTheme input[type="reset"]:hover,
.sv-defaultFormTheme input[type="submit"]:active,
.sv-defaultFormTheme input[type="submit"]:focus,
.sv-defaultFormTheme input[type="submit"]:hover {
  border-color: var(--env-element-primary-background-color-dark);
  color: var(--env-element-primary-font-color);
}

.sv-defaultFormTheme input[type="button"]:focus-visible,
.sv-defaultFormTheme input[type="reset"]:focus-visible,
.sv-defaultFormTheme input[type="submit"]:focus-visible {
  box-shadow: 0 0 0 var(--env-focus-offset) var(--env-focus-inner-color);
  outline: var(--env-focus-size) solid var(--env-focus-outline-color);
  outline-offset: var(--env-focus-offset);
}

.sv-defaultFormTheme input[type="button"]:focus,
.sv-defaultFormTheme input[type="reset"]:focus,
.sv-defaultFormTheme input[type="submit"]:focus {
  outline: none;
}

.sv-defaultFormTheme input[type="button"][disabled],
.sv-defaultFormTheme input[type="reset"][disabled],
.sv-defaultFormTheme input[type="submit"][disabled] {
  opacity: 0.55;
  pointer-events: none;
}


/* Checkbox and radio
---------------------------------------------------------*/

.sv-defaultFormTheme input[type="checkbox"],
.sv-defaultFormTheme input[type="radio"] {
  accent-color: var(--env-element-primary-background-color);
  box-sizing: border-box;
  padding: 0;
}


/* File input
---------------------------------------------------------*/

.sv-defaultFormTheme input[type="file"] {
  padding: 5px;
  width: 100%;
}


/* Text inputs, textarea and select
---------------------------------------------------------*/

.sv-defaultFormTheme input[type="text"],
.sv-defaultFormTheme input[type="email"],
.sv-defaultFormTheme input[type="url"],
.sv-defaultFormTheme input[type="tel"],
.sv-defaultFormTheme input[type="number"],
.sv-defaultFormTheme textarea,
.sv-defaultFormTheme select {
  background-color: var(--env-form-input-background-color);
  background-image: none;
  border: 1px solid var(--env-form-input-border-color);
  border-radius: var(--env-form-input-border-radius);
  box-sizing: border-box;
  color: var(--env-form-input-font-color);
  display: block;
  font-family: var(--env-form-font-family);
  font-size: var(--env-font-size-medium);
  line-height: 1.375;
  min-height: 2.75em;
  padding: .625em .75em;
  width: 100%;
}

.sv-defaultFormTheme input[type="text"][disabled],
.sv-defaultFormTheme input[type="email"][disabled],
.sv-defaultFormTheme input[type="url"][disabled],
.sv-defaultFormTheme input[type="tel"][disabled],
.sv-defaultFormTheme input[type="number"][disabled],
.sv-defaultFormTheme textarea[disabled],
.sv-defaultFormTheme select[disabled] {
  filter: opacity(0.5) grayscale(100%);
}

.sv-defaultFormTheme textarea {
  height: auto;
  resize: vertical;
}

.sv-defaultFormTheme select[multiple] {
  height: auto;
}

.sv-defaultFormTheme .sv-form-datefield select {
  display: inline-block;
  width: auto;
}


/* Focus
---------------------------------------------------------*/

.sv-defaultFormTheme input[type="file"]:focus-visible,
.sv-defaultFormTheme input[type="radio"]:focus-visible,
.sv-defaultFormTheme input[type="checkbox"]:focus-visible,
.sv-defaultFormTheme input[type="button"]:focus-visible,
.sv-defaultFormTheme input[type="submit"]:focus-visible,
.sv-defaultFormTheme input[type="reset"]:focus-visible,
.sv-defaultFormTheme input[type="text"]:focus-visible,
.sv-defaultFormTheme input[type="email"]:focus-visible,
.sv-defaultFormTheme input[type="url"]:focus-visible,
.sv-defaultFormTheme input[type="tel"]:focus-visible,
.sv-defaultFormTheme input[type="number"]:focus-visible,
.sv-defaultFormTheme textarea:focus-visible,
.sv-defaultFormTheme select:focus-visible {
  box-shadow: 0 0 0 var(--env-focus-offset) var(--env-focus-inner-color);
  outline: var(--env-focus-size) solid var(--env-focus-outline-color);
  outline-offset: var(--env-focus-offset);
}


/* Labels and text styles
---------------------------------------------------------*/

.sv-defaultFormTheme .sv-field-title-container.sv-bold label,
.sv-defaultFormTheme .sv-field-title-container.sv-bold span,
.sv-defaultFormTheme .sv-field-title-container.sv-bold p,
.sv-defaultFormTheme .sv-field-title-container.sv-bold h1,
.sv-defaultFormTheme .sv-field-title-container.sv-bold h2,
.sv-defaultFormTheme .sv-field-title-container.sv-bold h3,
.sv-defaultFormTheme .sv-field-title-container.sv-bold h4,
.sv-defaultFormTheme .sv-field-title-container.sv-bold h5,
.sv-defaultFormTheme .sv-field-title-container.sv-bold h6 {
  font-weight: bold;
}

.sv-defaultFormTheme .sv-form-singleselectionfield label,
.sv-defaultFormTheme .sv-form-multipleselectionfield label {
  cursor: pointer;
}


/* Special field adjustments
---------------------------------------------------------*/

.sv-form-orderfield td input[type="number"] {
  width: 80px;
}

.sv-booking-form .sv-form-orderfield input[type="number"] {
  width: 40px;
}

.sv-formField .sv-form-consent {
  padding-left: 1.8em;
  position: relative;
}

.sv-formField .sv-form-consent input[type="checkbox"] {
  left: 0;
  position: absolute;
}

.sv-formField .sv-textfield-input-size {
  float: right;
}

.sv-legacyForm .sv-textfield-input-size {
  display: block;
}

.sv-booking-form .sv-textfield-input-size {
  display: none;
}


/* Validation and errors
---------------------------------------------------------*/

.sv-formField .sv-has-error fieldset.sv-form-singleselectionfield,
.sv-formField .sv-has-error .sv-form-orderfield,
.sv-formField .sv-has-error .sv-form-datefield,
.sv-formField .sv-has-error .sv-form-gradefield,
.sv-formField .sv-has-error fieldset.sv-form-subalternativefield,
.sv-formField .sv-form-consent.sv-has-error {
  outline: 1px solid var(--env-ui-color-status-error-text);
}

.sv-formField .sv-has-error [aria-invalid],
.sv-formField .sv-has-error[aria-invalid],
.sv-formField .sv-has-error .sv-form-singleselectionfield,
.sv-formField .sv-has-error .sv-form-multipleselectionfield,
.sv-formField .sv-has-error .sv-form-textfield,
.sv-formField .sv-form-userattributefield .sv-has-error input,
.sv-formField .sv-form-userattributefield input.sv-has-error,
.sv-formField .sv-has-error .sv-form-filefield,
.sv-formField .sv-has-error .sv-form-participantsfield input,
.sv-formField .sv-has-error .sv-form-recipientsfield {
  border: 1px solid var(--env-ui-color-status-error-text);
}

.sv-formField [role="alert"],
.sv-textfield-limit-exceeded {
  color: var(--env-ui-color-status-error-text);
}