/* Comfort Isolatie contactformulier
 * Kleuren komen van comfort-isolatie.nl (thema-variabelen van de live site).
 * Pas het lettertype aan via --ci-font als de huisstijl een ander font voorschrijft.
 */

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/dm-sans-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/dm-sans-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/dm-sans-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/dm-sans-latin-ext-500-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/dm-sans-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/dm-sans-latin-ext-700-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Huisstijl */
  --ci-mint: #02d6a8;
  --ci-mint-hover: #00c29a;
  --ci-mint-soft: #e6faf4;
  --ci-mint-line: rgba(2, 214, 168, 0.45);
  --ci-navy: #012c3a;
  --ci-navy-soft: #1d4553;
  --ci-sand: #efc88b;
  --ci-cream: #f7eee4;

  /* Afgeleid */
  --ci-text: var(--ci-navy);
  --ci-muted: #4b6670;
  --ci-surface: #ffffff;
  --ci-border: #e8dccd;
  --ci-input-border: #7a8c93;
  --ci-error: #b42318;
  --ci-error-soft: #fff4f3;
  --ci-info-soft: #eef6f8;

  --ci-font: 'DM Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --ci-radius-card: 20px;
  --ci-radius-input: 12px;
  --ci-radius-button: 999px;
  --ci-shadow: 0 1px 2px rgba(1, 44, 58, 0.04), 0 12px 32px rgba(1, 44, 58, 0.07);
  --ci-focus: 0 0 0 3px #ffffff, 0 0 0 5px var(--ci-navy);
  --ci-gutter: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ci-cream);
  color: var(--ci-text);
  font-family: var(--ci-font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--ci-navy);
  text-decoration: underline;
  text-decoration-color: var(--ci-mint);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 3px solid var(--ci-navy);
  outline-offset: 2px;
  border-radius: 4px;
}

[hidden] {
  display: none !important;
}

.container {
  width: 100%;
  max-width: 800px;
  margin-inline: auto;
  padding-inline: var(--ci-gutter);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--ci-navy);
  color: #ffffff;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus {
  top: 12px;
}

/* Header */

.site-header {
  padding-block: 20px;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  border-radius: 6px;
}
.brand-logo {
  height: 40px;
  width: auto;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding-inline: 4px;
  color: var(--ci-navy);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.back-short {
  display: none;
}
.back-link:hover span {
  text-decoration: underline;
  text-decoration-color: var(--ci-mint);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* Intro */

main {
  flex: 1;
  padding-bottom: 40px;
}

.intro {
  padding-block: 24px 28px;
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--ci-muted);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  font-size: clamp(2rem, 1.35rem + 2.6vw, 2.875rem);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.highlight {
  background: linear-gradient(transparent 60%, var(--ci-mint-line) 60%, var(--ci-mint-line) 92%, transparent 92%);
  padding-inline: 2px;
}
.lead {
  max-width: 60ch;
  margin: 16px 0 0;
  color: var(--ci-navy-soft);
  font-size: 1.125rem;
  line-height: 1.6;
}

/* Kaart */

.card {
  background: var(--ci-surface);
  border: 1px solid var(--ci-border);
  border-radius: var(--ci-radius-card);
  box-shadow: var(--ci-shadow);
  padding: 36px 40px 40px;
}

.form-intro {
  margin: 0 0 24px;
  color: var(--ci-muted);
  font-size: 0.9375rem;
}

.group {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  min-width: 0;
}
.group + .group {
  margin-top: 16px;
  padding-top: 28px;
  border-top: 1px solid var(--ci-border);
}
.group-title {
  /* float voorkomt dat de legend op de bovenrand van de fieldset wordt getekend */
  float: left;
  width: 100%;
  margin: 0 0 16px;
  padding: 0;
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.group-title + * {
  clear: both;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}
.row-address {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
}

.field {
  margin-bottom: 20px;
  min-width: 0;
}

label,
.label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 0.9375rem;
}
.optional {
  color: var(--ci-muted);
  font-weight: 400;
}
.hint {
  margin: -2px 0 8px;
  color: var(--ci-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}
.hint-row {
  margin: -8px 0 20px;
}

input[type='text'],
input[type='email'],
input[type='tel'],
select,
textarea {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 1.5px solid var(--ci-input-border);
  border-radius: var(--ci-radius-input);
  background: #ffffff;
  color: var(--ci-text);
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
}
textarea {
  min-height: 168px;
  resize: vertical;
}
input:hover,
select:hover,
textarea:hover {
  border-color: var(--ci-navy);
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--ci-navy);
  box-shadow: 0 0 0 4px var(--ci-mint-line);
}
::placeholder {
  color: #6f838a;
}

.select-wrap {
  position: relative;
}
.select-wrap::after {
  content: '';
  position: absolute;
  right: 18px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -7px;
  border-right: 2px solid var(--ci-navy);
  border-bottom: 2px solid var(--ci-navy);
  transform: rotate(45deg);
  pointer-events: none;
}
select {
  padding-right: 48px;
  cursor: pointer;
}
select:invalid,
select option[value=''] {
  color: var(--ci-muted);
}
select option {
  color: var(--ci-text);
}

.counter {
  margin: 6px 0 0;
  color: var(--ci-muted);
  font-size: 0.8125rem;
  text-align: right;
}
.counter.is-near-limit {
  color: var(--ci-error);
}

/* Foutmeldingen bij velden */

.field-error {
  display: flex;
  gap: 6px;
  margin: 8px 0 0;
  color: var(--ci-error);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
}
.field-error::before {
  content: '!';
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--ci-error);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
}
.field.has-error input,
.field.has-error select,
.field.has-error textarea,
.field.has-error .dropzone {
  border-color: var(--ci-error);
  background-color: var(--ci-error-soft);
}

/* Foutoverzicht en meldingen */

.error-summary {
  margin: 0 0 24px;
  padding: 18px 20px;
  border: 2px solid var(--ci-error);
  border-radius: 14px;
  background: var(--ci-error-soft);
}
.error-summary:focus {
  outline: 3px solid var(--ci-navy);
  outline-offset: 3px;
}
.error-summary-title {
  margin: 0 0 6px;
  font-size: 1.0625rem;
  font-weight: 700;
}
.error-summary-text {
  margin: 0;
}
.error-summary-list {
  margin: 8px 0 0;
  padding-left: 20px;
}
.error-summary-list a {
  color: var(--ci-error);
  font-weight: 500;
  text-decoration-color: currentColor;
}
.error-summary-ref {
  margin: 10px 0 0;
  color: var(--ci-muted);
  font-size: 0.8125rem;
}

.notice {
  margin: 0 0 24px;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 0.9375rem;
}
.notice-info {
  background: var(--ci-info-soft);
  border: 1px solid #cfe3e8;
}
.notice-error {
  background: var(--ci-error-soft);
  border: 1px solid var(--ci-error);
}

/* Bijlagen */

.dropzone {
  position: relative;
  border: 1.5px dashed var(--ci-input-border);
  border-radius: var(--ci-radius-input);
  background: #fcfaf7;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--ci-navy);
  background: var(--ci-mint-soft);
}
.dropzone:focus-within {
  border-style: solid;
  border-color: var(--ci-navy);
  box-shadow: 0 0 0 4px var(--ci-mint-line);
}
.file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.dropzone-body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 76px;
  padding: 16px;
  text-align: center;
  pointer-events: none;
}
.dropzone-icon {
  flex: none;
  color: var(--ci-navy);
}
.dropzone-body strong {
  text-decoration: underline;
  text-decoration-color: var(--ci-mint);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.dropzone-or {
  color: var(--ci-muted);
}

.file-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.file-list:empty {
  display: none;
}
.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--ci-border);
  border-radius: 10px;
  background: #ffffff;
}
.file-item + .file-item {
  margin-top: 8px;
}
.file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9375rem;
  font-weight: 500;
}
.file-size {
  flex: none;
  color: var(--ci-muted);
  font-size: 0.8125rem;
}
.file-remove {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ci-navy);
  cursor: pointer;
}
.file-remove:hover {
  background: var(--ci-cream);
}

/* Honeypot: onzichtbaar voor mensen, wel aanwezig voor bots */

.hp {
  position: absolute !important;
  left: -10000px !important;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Turnstile */

.turnstile {
  margin: 8px 0 16px;
  min-height: 0;
}
.turnstile:empty {
  margin: 0;
}

.privacy {
  margin: 0 0 24px;
  color: var(--ci-muted);
  font-size: 0.875rem;
}

/* Knoppen */

.actions {
  display: flex;
}

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 14px 32px;
  border: 2px solid transparent;
  border-radius: var(--ci-radius-button);
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.button:focus-visible {
  outline: none;
  box-shadow: var(--ci-focus);
}
.button:active {
  transform: translateY(1px);
}

.button-primary {
  background: var(--ci-mint);
  color: var(--ci-navy);
}
.button-primary:hover {
  background: var(--ci-mint-hover);
  color: var(--ci-navy);
}

.button-secondary {
  background: transparent;
  border-color: var(--ci-navy);
  color: var(--ci-navy);
}
.button-secondary:hover {
  background: var(--ci-navy);
  color: #ffffff;
}

.button[aria-disabled='true'],
.button:disabled {
  cursor: progress;
}

.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(1, 44, 58, 0.25);
  border-top-color: var(--ci-navy);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.is-busy .spinner {
  display: inline-block;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Bevestiging */

.success {
  padding: 16px 0 4px;
  text-align: center;
}
.success-icon {
  display: inline-grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--ci-mint-soft);
  color: var(--ci-mint);
}
.success-icon svg {
  width: 56px;
  height: 56px;
}
.success h2 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 1.875rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
}
.success h2:focus {
  outline: none;
}
.success p {
  max-width: 52ch;
  margin: 0 auto 12px;
  color: var(--ci-navy-soft);
}
.success-ref {
  display: inline-block;
  margin-top: 4px !important;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--ci-cream);
  color: var(--ci-navy) !important;
  font-size: 0.9375rem;
}
.success-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

/* Alternatief contact en footer */

.alt-contact {
  margin-top: 28px;
  text-align: center;
  color: var(--ci-navy-soft);
}
.alt-contact p {
  margin: 0;
}

.site-footer {
  padding-block: 24px 32px;
  border-top: 1px solid var(--ci-border);
  color: var(--ci-muted);
  font-size: 0.875rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}
.footer-inner p {
  margin: 0;
}
.site-footer a {
  color: var(--ci-muted);
  text-decoration-color: currentColor;
  text-decoration-thickness: 1px;
}

/* Mobiel */

@media (max-width: 640px) {
  .site-header {
    padding-block: 14px;
  }
  .brand-logo {
    height: 32px;
  }
  .back-link {
    font-size: 0.875rem;
  }
  .back-long {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .back-short {
    display: inline;
  }
  .intro {
    padding-block: 12px 20px;
  }
  .lead {
    font-size: 1.0625rem;
  }
  .card {
    padding: 24px 20px 28px;
    border-radius: 16px;
  }
  .row,
  .row-address {
    grid-template-columns: 1fr;
  }
  .row-address {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 0 12px;
  }
  .actions .button,
  .success-actions .button {
    width: 100%;
  }
  .dropzone-or {
    display: none;
  }
  .footer-inner {
    flex-direction: column;
  }
}

@media (max-width: 340px) {
  .card {
    padding-inline: 16px;
  }
  .row-address {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .spinner {
    animation: none;
    border-top-color: rgba(1, 44, 58, 0.25);
  }
}

@media (forced-colors: active) {
  .button-primary {
    border-color: ButtonText;
  }
  .field-error::before {
    forced-color-adjust: none;
  }
}
