﻿.widget_form {
  max-width: 800px;
  margin: 0 auto;
  font-family: Montserrat, sans-serif;
}

.ktc-default-section .widget_field {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: center;
  column-gap: 20px;
  row-gap: 8px;
  margin-bottom: 20px;
}

.ktc-default-section .widget_label-wrapper {
  text-align: right;
  padding-top: 0;
}

@media (max-width: 640px) {
  .ktc-default-section .widget_field {
    grid-template-columns: 1fr;
    row-gap: 6px;
  }

  .ktc-default-section .widget_label-wrapper {
    text-align: left;
    padding-top: 0;
  }
}

.ktc-default-section .widget_label {
  color: #084f5c;
  font-weight: 400;
  font-size: 1rem;
}

.ktc-default-section .widget_label--required::after {
  content: " *";
  color: #c43a5b;
}

.ktc-default-section .widget_editor-wrapper {
  min-width: 0;
}

.ktc-default-section .widget_input {
  box-sizing: border-box;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #008773;
  border-radius: 2px;
  color: #084f5c;
  font-family: inherit;
  font-size: 1rem;
  background-color: #ffffff;
}

.ktc-default-section .widget_input::placeholder {
  color: #707070;
}

.ktc-default-section .widget_input:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  border-color: #07434e;
  box-shadow:
    0 0 0 2px #ffffff,
    0 0 0 4px #07434e;
}

.ktc-default-section textarea.widget_input {
  min-height: 130px;
  resize: vertical;
}

.ktc-default-section select.widget_input {
  height: 40px;
  padding: 8px 56px 8px 16px;
  border-color: #084f5c;
  border-radius: 0;
  color: #084f5c;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%23084f5c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 24px 24px;
}

/* :open reflects the native popup's actual visibility (unlike :focus, which stays applied after the popup closes) */
.ktc-default-section select.widget_input:open {
  border-color: #084f5c;
  outline: 2px solid #07434e;
  outline-offset: 2px;
  box-shadow: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 14l5-5 5 5' fill='none' stroke='%23084f5c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* fallback for browsers without :open support (Baseline 2026) - :focus is a rough approximation since it can't tell open from closed-but-focused */
@supports not selector(:open) {
  .ktc-default-section select.widget_input:focus {
    border-color: #084f5c;
    outline: 2px solid #07434e;
    outline-offset: 2px;
    box-shadow: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 14l5-5 5 5' fill='none' stroke='%23084f5c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
}

/* the dropped-down option list is OS-rendered chrome in most browsers - "customizable select" (Chrome/Edge/Opera only, no markup changes needed) lets us restyle it to match the design; other browsers keep the native popup, unaffected */
@supports (appearance: base-select) {
  .ktc-default-section select.widget_input,
  .ktc-default-section select.widget_input::picker(select) {
    appearance: base-select;
  }

  /* base-select adds its own default arrow icon alongside our existing chevron background-image - hide it to avoid showing two */
  .ktc-default-section select.widget_input::picker-icon {
    display: none;
  }

  .ktc-default-section select.widget_input::picker(select) {
    box-sizing: border-box;
    width: anchor-size(width);
    margin-top: 1px;
    padding: 8px;
    gap: 8px;
    border: 1px solid #cccdd2;
    border-radius: 0 0 6px 6px;
    background-color: #ffffff;
  }

  .ktc-default-section select.widget_input option {
    box-sizing: border-box;
    align-items: center;
    height: 32px;
    padding: 4px 8px;
    border-radius: 6px;
    color: #084f5c;
    font-family: inherit;
    font-size: 1rem;
  }

  .ktc-default-section select.widget_input option:hover,
  .ktc-default-section select.widget_input option:focus {
    background-color: #e0e1eb;
  }

  .ktc-default-section select.widget_input option::checkmark {
    color: #084f5c;
  }
}

.ktc-default-section .ktc-checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ktc-default-section .ktc-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* nudges the first checkbox down so its centre lines up with the field label, matching the text inputs */
.ktc-default-section .widget_component-wrapper > .ktc-checkbox:first-child,
.ktc-default-section .ktc-checkbox-list > .ktc-checkbox:first-child {
  padding-top: 8px;
}

.ktc-default-section .ktc-checkbox:has(.widget_input:disabled) {
  opacity: 0.5;
}

.ktc-default-section .ktc-checkbox .widget_input {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  border: 1px solid #707070;
  border-radius: 4px;
  background-color: #ffffff;
  position: relative;
  cursor: pointer;
}

.ktc-default-section .ktc-checkbox .widget_input:checked {
  border-color: #008773;
  background-color: #008773;
}

.ktc-default-section .ktc-checkbox .widget_input:checked::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 4px;
  width: 6px;
  height: 12px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.ktc-default-section .ktc-checkbox .widget_input:disabled {
  cursor: not-allowed;
}

.ktc-default-section .ktc-checkbox label {
  color: #084f5c;
  font-size: 1rem;
  cursor: pointer;
}

.ktc-default-section .ktc-checkbox .widget_input:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow:
    0 0 0 2px #ffffff,
    0 0 0 4px #07434e;
}

.ktc-default-section .ktc-radio-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ktc-default-section .ktc-radio {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* nudges the first radio down so its centre lines up with the field label, matching the text inputs */
.ktc-default-section .widget_component-wrapper > .ktc-radio:first-child,
.ktc-default-section .ktc-radio-list > .ktc-radio:first-child {
  padding-top: 8px;
}

.ktc-default-section .ktc-radio:has(.widget_input:disabled) {
  opacity: 0.5;
}

.ktc-default-section .ktc-radio .widget_input {
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-content: center;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  border: 1.5px solid #084f5c;
  border-radius: 999px;
  background-color: #ffffff;
  cursor: pointer;
}

.ktc-default-section .ktc-radio .widget_input:checked {
  border: 2px solid #008773;
}

/* grid + place-content centers the dot exactly, avoiding subpixel rounding from absolute-positioned offsets */
.ktc-default-section .ktc-radio .widget_input:checked::after {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background-color: #008773;
}

.ktc-default-section .ktc-radio .widget_input:disabled {
  cursor: not-allowed;
}

.ktc-default-section .ktc-radio label {
  color: #084f5c;
  font-size: 1rem;
  cursor: pointer;
}

.ktc-default-section .ktc-radio .widget_input:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow:
    0 0 0 2px #ffffff,
    0 0 0 4px #07434e;
}

.ktc-default-section .ktc-file-component-wrapper {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* the native control is kept focusable/clickable for accessibility but not shown; the label is the visible button */
.ktc-default-section .ktc-file-component-wrapper input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ktc-default-section .ktc-file-component-wrapper label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid #008773;
  border-radius: 2px;
  background-color: #ffffff;
  color: #07434e;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}

.ktc-default-section .ktc-file-component-wrapper label:hover {
  background-color: #eff0f5;
}

/* .ktc-default-section .ktc-file-component-wrapper .ktc-uploader-icon-button {
  color: #07434e;
  font-weight: 700;
  letter-spacing: 1px;
} */

/* the file name already replaces the label text, so the separate replacement element is not needed */
.ktc-default-section .ktc-file-component-wrapper .ktc-uploader-replacement {
  display: none;
}

.ktc-default-section .ktc-file-component-wrapper .ktc-uploader-text-button {
  color: #008773;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
}

.ktc-default-section .ktc-file-component-wrapper label:has(~ input:focus) {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow:
    0 0 0 2px #ffffff,
    0 0 0 4px #07434e;
}

/* excludes checkbox/radio so their circular/square custom appearance (styled above) is never overridden */
.ktc-default-section
  .widget_input.input-validation-error:not([type="checkbox"]):not(
    [type="radio"]
  ) {
  border: 2px solid #c43a5b;
}

.ktc-default-section .field-validation-error:empty {
  display: none;
}

.ktc-default-section .field-validation-error {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  /* asymmetric top/bottom compensates for the icon glyph and text line-box both sitting slightly high within their boxes */
  padding: 4.6px 8px 3.4px;
  border-radius: 6px;
  background-color: #c43a5b;
  color: #ffffff;
  font-size: 0.875rem;
  line-height: 1.4;
}

.ktc-default-section .field-validation-error::before {
  content: "";
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px 20px;
}

.ktc-default-section .widget_explanation-text {
  color: #707070;
  font-size: 0.85rem;
  margin-top: 4px;
}

.widget_submit-button {
  /* lines up with the input column, which is offset by the label column width + gap */
  margin-left: 200px;
  padding: 10px 28px;
  border: 2px solid #afca1a;
  border-radius: 2px;
  background-color: #afca1a;
  color: #07434e;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}

.widget_submit-button:hover {
  background-color: #ffffff;
}

.widget_submit-button:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow:
    0 0 0 2px #ffffff,
    0 0 0 4px #07434e;
}

@media (max-width: 640px) {
  .widget_form {
    max-width: 100%;
    box-sizing: border-box;
    padding-left: 16px;
    padding-right: 16px;
  }

  .widget_submit-button {
    margin-left: 0;
  }
}
