/**
 * Renovaraam — uniforme formuliervelden (geen native browser-chrome).
 * Laadt na brand-ui.css; overschrijft restanten uit main.css waar nodig.
 */

/* —— Reset native UI op alle interactieve velden —— */
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Native date/time pickers worden vervangen door datepicker.js */
input[type="date"]:not([data-rv-date-built]) {
  pointer-events: none;
}

/* —— Tekst, e-mail, tel, number, textarea —— */
.rv-field,
.wizard input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.wizard textarea,
.wizard select.rv-select__native,
.rv-chat__form input:not([type="file"]):not([type="hidden"]),
.rv-chat__form textarea,
.contact-section input:not([type="file"]):not([type="hidden"]),
.contact-section textarea,
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not(.rv-select__native),
textarea,
select.rv-select__native {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.75rem 0 0.65rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  line-height: 1.45;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

textarea {
  min-height: 6.5rem;
  resize: vertical;
  padding-top: 0.65rem;
}

.rv-field:focus,
.wizard input:focus,
.wizard textarea:focus,
.wizard select.rv-select__native:focus,
.rv-chat__form input:focus,
.rv-chat__form textarea:focus,
.contact-section input:focus,
.contact-section textarea:focus,
input:focus:not(.rv-select__native),
textarea:focus {
  outline: none;
  border-bottom-color: var(--color-blue);
  box-shadow: inset 0 -2px 0 var(--color-blue);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
  box-shadow: 0 0 0 1000px var(--surface) inset;
  transition: background-color 99999s ease-out 0s;
}

/* —— Custom datumkiezer (geen native kalender) —— */
.rv-date-picker {
  position: relative;
  width: 100%;
  max-width: 36rem;
}

.rv-date-picker__field {
  display: grid;
  grid-template-columns: 1fr 2.75rem;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.rv-date-picker.is-open .rv-date-picker__field,
.rv-date-picker__field:focus-within {
  border-bottom-color: var(--color-blue);
  box-shadow: inset 0 -2px 0 var(--color-blue);
}

.rv-date-picker__display {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0.75rem 0 0.65rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.rv-date-picker__display.is-placeholder {
  color: var(--muted);
  font-weight: 400;
}

.rv-date-picker__display:focus-visible {
  outline: none;
}

.rv-date-picker__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--color-blue);
  cursor: pointer;
}

.rv-date-picker__toggle::before {
  content: "";
  width: 1.15rem;
  height: 1.15rem;
  background-color: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M3 2h10a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm1 2v1h8V4H4zm7 3H4v6h7V7z'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M3 2h10a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm1 2v1h8V4H4zm7 3H4v6h7V7z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.rv-date-picker__toggle:hover,
.rv-date-picker__toggle:focus-visible {
  background: rgba(33, 70, 139, 0.06);
  outline: none;
}

.rv-date-picker__popover {
  position: absolute;
  z-index: 220;
  left: 0;
  top: calc(100% + 4px);
  min-width: min(100%, 17.5rem);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 14px 36px rgba(8, 9, 12, 0.16);
}

.rv-date-picker__popover[hidden] {
  display: none !important;
}

.rv-date-picker__panel {
  padding: 0.75rem;
}

.rv-date-picker__head {
  display: grid;
  grid-template-columns: 2.25rem 1fr 2.25rem;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}

.rv-date-picker__title {
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
}

.rv-date-picker__nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 1.15rem;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
}

.rv-date-picker__nav:hover {
  border-color: var(--color-blue);
  color: var(--color-blue);
}

.rv-date-picker__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.rv-date-picker__wd {
  padding: 0.35rem 0;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  background: var(--surface-2);
  color: var(--muted);
}

.rv-date-picker__cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.1rem;
  padding: 0;
  border: 0;
  background: var(--surface);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}

.rv-date-picker__cell:hover:not(.is-disabled):not(.rv-date-picker__cell--empty) {
  background: rgba(33, 70, 139, 0.1);
  color: var(--color-blue);
}

.rv-date-picker__cell--empty {
  background: var(--surface-2);
  cursor: default;
}

.rv-date-picker__cell.is-today {
  outline: 2px solid var(--color-blue);
  outline-offset: -2px;
}

.rv-date-picker__cell.is-selected {
  background: var(--color-blue);
  color: #fff;
}

.rv-date-picker__cell.is-selected:hover {
  background: #1a3870;
  color: #fff;
}

.rv-date-picker__cell.is-disabled {
  color: var(--muted);
  opacity: 0.45;
  cursor: not-allowed;
  background: var(--surface-2);
}

.rv-date-picker__foot {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.rv-date-picker__foot-btn {
  flex: 1 1 0;
  min-height: 2.1rem;
  padding: 0 0.5rem;
  border: 1px solid var(--line);
  background: var(--surface);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}

.rv-date-picker__foot-btn:hover:not(:disabled) {
  border-color: var(--color-blue);
  color: var(--color-blue);
}

.rv-date-picker__foot-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.form-row--date .rv-date-picker {
  margin-top: 0.15rem;
}

/* —— Bestand upload —— */
.rv-file-field {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  min-height: 3rem;
}

.rv-file-field__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  border: 0;
  z-index: 2;
}

.rv-file-field__btn {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.rv-file-field__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: border-color var(--t-fast), color var(--t-fast), background-color var(--t-fast);
}

.rv-file-field__btn:hover,
.rv-file-field__btn:focus-visible {
  border-color: var(--color-blue);
  color: var(--color-blue);
  outline: none;
}

.rv-file-field__name {
  font-size: 0.88rem;
  color: var(--muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rv-file-field:has(.rv-file-field__input:focus-visible) {
  border-bottom-color: var(--color-blue);
  box-shadow: inset 0 -2px 0 var(--color-blue);
}

.rv-file-field.has-file .rv-file-field__btn {
  border-color: var(--color-blue);
  color: var(--color-blue);
}

.rv-file-field__thumb {
  display: block;
  width: 100%;
  max-width: 200px;
  margin-top: 0.5rem;
  border: 1px solid var(--line);
}

/* —— Custom select (geen native dropdown) —— */
.select-wrap {
  position: relative;
  max-width: 100%;
}

.select-wrap::after {
  display: none;
}

.rv-select {
  position: relative;
  width: 100%;
  max-width: 36rem;
}

.rv-select__native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.rv-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  margin: 0;
  padding: 0.75rem 2.25rem 0.65rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.rv-select__trigger:hover {
  border-bottom-color: var(--color-blue);
}

.rv-select__trigger:focus-visible {
  outline: none;
  border-bottom-color: var(--color-blue);
  box-shadow: inset 0 -2px 0 var(--color-blue);
}

.rv-select__trigger::after {
  content: "";
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  margin-top: -0.2rem;
  transition: transform var(--t-fast), border-color var(--t-fast);
}

.rv-select.is-open .rv-select__trigger::after {
  transform: rotate(-135deg);
  margin-top: 0.15rem;
  border-color: var(--color-blue);
}

.rv-select__label.is-placeholder {
  color: var(--muted);
  font-weight: 400;
}

.rv-select__listbox {
  position: absolute;
  z-index: 200;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  max-height: 16rem;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 12px 32px rgba(8, 9, 12, 0.14);
}

.rv-select__listbox[hidden] {
  display: none !important;
}

.rv-select__option {
  margin: 0;
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: background-color var(--t-fast), color var(--t-fast);
}

.rv-select__option:hover,
.rv-select__option:focus {
  outline: none;
  background: var(--surface-2);
  color: var(--color-blue);
}

.rv-select__option.is-selected {
  background: rgba(33, 70, 139, 0.08);
  color: var(--color-blue);
}

.rv-select__option.is-disabled {
  color: var(--muted);
  cursor: default;
  pointer-events: none;
}

.rv-select.is-invalid .rv-select__trigger {
  border-bottom-color: var(--color-red);
  box-shadow: inset 0 -2px 0 var(--color-red);
}

/* —— Labels & hints —— */
.form-row label {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
}

.form-hint,
.wizard-photo-hint {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

/* —— FAQ accordion — volledig eigen stijl —— */
.faq-accordion {
  margin-top: 0;
  border-top: 1px solid var(--line);
  background: transparent;
}

.faq-home .section-actions,
.faq-page-section .section-actions {
  margin-top: clamp(1.75rem, 4vw, 2.35rem);
}

.faq-item {
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.faq-item:hover {
  background: transparent;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 1.02rem;
  padding: clamp(1.1rem, 2.5vw, 1.35rem) 3.25rem clamp(1.1rem, 2.5vw, 1.35rem) 0;
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  position: relative;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  transition: color var(--t-fast);
}

.faq-item summary::-webkit-details-marker,
.faq-item summary::marker {
  display: none;
  content: "";
}

.faq-item summary:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: -2px;
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  margin-top: -0.6rem;
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1;
  color: var(--color-blue);
  flex-shrink: 0;
  transition: color var(--t-fast);
}

.faq-item[open] summary::after {
  content: "−";
  color: var(--color-red);
}

.faq-item[open] summary {
  color: var(--color-blue);
}

.faq-item__a {
  padding: 0 0 clamp(1.25rem, 3vw, 1.65rem);
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.6;
  max-width: 52rem;
}

.faq-home .btn-outline {
  margin-top: 0.25rem;
}

/* —— Chat form velden —— */
.rv-chat__form input:not([type="file"]),
.rv-chat__form textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  min-height: 2.5rem;
}

.rv-chat__form .rv-date-picker {
  max-width: 100%;
}

.rv-chat__form .rv-date-picker__field {
  border: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.rv-chat__form .rv-date-picker__display {
  padding: 0.6rem 0.75rem;
}

.rv-chat__form textarea {
  min-height: 4.5rem;
}

.rv-chat__form .rv-file-field {
  border: 1px solid var(--line);
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

/* —— Invalid state (HTML5 + wizard) —— */
input[aria-invalid="true"],
textarea[aria-invalid="true"],
.rv-select.is-invalid .rv-select__trigger {
  border-bottom-color: var(--color-red) !important;
  box-shadow: inset 0 -2px 0 var(--color-red) !important;
}
