/* =========================================================================
   FORMS AND CONSENT — the contact form (js/contact.js), the cookie banner
   (js/cookie-consent.js), the cookie policy page and the footer additions.
   Everything reads the theme tokens, so both themes are covered.
   ========================================================================= */
:root { --danger: #c62828; --danger-soft: #c628281a; }
:root[data-theme="dark"] { --danger: #ff8a80; --danger-soft: #ff8a801f; }

/* ---- Contact form --------------------------------------------------------- */
.contact-form-card { max-width: 860px; scroll-margin-top: 96px; }
.cf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; }
.cf-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; margin: 0; padding: 0; border: 0; }
.cf-field.cf-wide { grid-column: 1 / -1; }
.cf-field > label, .cf-legend { padding: 0; font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--foreground); }
.cf-legend { margin-bottom: 7px; }
.cf-field input:not([type=radio]):not([type=checkbox]), .cf-field select, .cf-field textarea, .cf-combo-toggle {
  width: 100%; min-height: 42px; padding: 9px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--background); color: var(--foreground); font: inherit; font-size: var(--fs-sm); line-height: 1.5;
  transition: border-color .2s, box-shadow .2s;
}
.cf-field textarea { min-height: 140px; padding: 12px 14px; resize: vertical; line-height: 1.6; }
.cf-field select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2301aef2' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
.cf-field select option { background: var(--card); color: var(--foreground); }
.cf-field input::placeholder, .cf-field textarea::placeholder, .cf-combo-placeholder { color: var(--muted-foreground); }
.cf-field input:not([type=radio]):not([type=checkbox]):focus, .cf-field select:focus, .cf-field textarea:focus, .cf-combo-toggle:focus-visible, .cf-combo.is-open .cf-combo-toggle {
  outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}
.cf-field.is-invalid input:not([type=radio]):not([type=checkbox]), .cf-field.is-invalid select, .cf-field.is-invalid textarea, .cf-field.is-invalid .cf-combo-toggle { border-color: var(--danger); }
.cf-error { display: none; font-size: var(--fs-xs); line-height: 1.5; color: var(--danger); }
.cf-field.is-invalid .cf-error { display: block; }

.cf-choice { display: flex; flex-wrap: wrap; gap: 10px; }
.cf-choice label { display: inline-flex; align-items: center; gap: 9px; padding: 8px 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--background); font-size: var(--fs-sm); cursor: pointer; transition: border-color .2s, background-color .2s; }
.cf-choice input { width: 15px; height: 15px; margin: 0; accent-color: var(--brand); }
.cf-choice label:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); }
.cf-choice label:has(input:focus-visible) { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }

/* Searchable pickers: the country, and the calling code in front of the phone number. */
.cf-phone { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 8px; }
.cf-combo { position: relative; min-width: 0; }
.cf-combo-toggle { position: relative; display: flex; align-items: center; padding-right: 38px; text-align: left; cursor: pointer; }
.cf-combo-toggle::after { content: ""; position: absolute; right: 12px; top: 50%; width: 16px; height: 16px; margin-top: -8px; pointer-events: none; transition: transform .2s;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2301aef2' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / 16px no-repeat; }
.cf-combo.is-open .cf-combo-toggle::after { transform: rotate(180deg); }
.cf-combo-label { display: flex; align-items: center; gap: 9px; min-width: 0; }
.cf-combo-label .cf-combo-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-flag { flex-shrink: 0; font-size: 17px; line-height: 1; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
.cf-combo-panel { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: 100%; min-width: 260px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--card); box-shadow: var(--shadow-pop); }
.cf-combo-panel[hidden] { display: none; }
.cf-combo-list { list-style: none; max-height: 250px; margin: 8px 0 0; padding: 0; overflow: auto; overscroll-behavior: contain; }
.cf-combo-list li { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--radius-md); font-size: var(--fs-sm); line-height: 1.4; cursor: pointer; }
.cf-combo-list .cf-combo-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-combo-list .cf-combo-code { flex-shrink: 0; font-size: var(--fs-xs); color: var(--muted-foreground); }
.cf-combo-list li.is-active, .cf-combo-list li:hover { background: var(--accent); }
.cf-combo-list li[aria-selected="true"] { color: var(--link); }
.cf-combo-list li.cf-combo-empty { color: var(--muted-foreground); cursor: default; background: none; }

.cf-trap, .cf-trap[hidden] { display: none; }
.cf-consent { display: flex; align-items: flex-start; gap: 10px; font-size: var(--fs-sm); font-weight: var(--fw-normal); line-height: 1.6; color: var(--muted-foreground); cursor: pointer; }
.cf-consent input { flex-shrink: 0; width: 17px; height: 17px; margin: 3px 0 0; accent-color: var(--brand); }
.cf-consent a, .cf-recaptcha-gate a, .cf-note a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.cf-verify[hidden], .cf-recaptcha[hidden], .cf-recaptcha-gate[hidden] { display: none; }
.cf-recaptcha { min-height: 78px; }
.cf-recaptcha-gate { padding: 14px 16px; border: 1px dashed var(--border); border-radius: var(--radius); font-size: var(--fs-sm); line-height: 1.6; color: var(--muted-foreground); }
.cf-recaptcha-gate strong { color: var(--foreground); }
.cf-recaptcha-gate-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 12px; }

.cf-status { margin-top: 16px; font-size: var(--fs-sm); line-height: 1.5; }
.cf-status:empty { display: none; }
.cf-status.is-error { padding: 11px 14px; border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); border-radius: var(--radius); background: var(--danger-soft); color: var(--danger); }
.cf-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin-top: 18px; }
.cf-actions .btn:disabled { opacity: .65; cursor: wait; }
.cf-note { flex: 1 1 280px; max-width: 520px; margin: 0; font-size: var(--fs-xs); line-height: 1.6; color: var(--muted-foreground); }

.cf-success { display: none; justify-items: center; gap: 12px; padding: 18px 4px 6px; text-align: center; outline: 0; }
.contact-form-card.is-sent .contact-form { display: none; }
.contact-form-card.is-sent .cf-success { display: grid; }
.cf-success h2 { font-size: 22px; }
.cf-success p { max-width: 460px; font-size: var(--fs-sm); line-height: 1.6; color: var(--muted-foreground); }
.cf-success strong { color: var(--foreground); overflow-wrap: anywhere; }
.cf-reference { padding: 6px 14px; border: 1px solid color-mix(in srgb, var(--brand) 40%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--brand) 10%, transparent); font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.cf-reference[hidden] { display: none; }

@media screen and (max-width: 700px) {
  .cf-grid { grid-template-columns: 1fr; }
  .cf-phone { grid-template-columns: 112px minmax(0, 1fr); }
  .cf-actions { flex-direction: column-reverse; align-items: stretch; }
  .cf-actions .btn { width: 100%; }
}

/* ---- Cookie banner --------------------------------------------------------- */
.cookie-consent { position: fixed; z-index: 90; left: 24px; bottom: 24px; width: min(460px, calc(100vw - 48px)); }
.cookie-consent[hidden] { display: none; }
.cookie-consent-card { padding: 22px 24px; border: 1px solid var(--border); border-radius: var(--radius-2xl); background: var(--card); box-shadow: var(--shadow-pop); outline: 0; }
.cookie-consent-card:focus-visible { border-color: var(--brand); }
.cookie-consent-head { display: flex; align-items: center; gap: 10px; }
.cookie-consent-icon { width: 20px; height: 20px; flex-shrink: 0; color: var(--brand); }
.cookie-consent h2 { font-size: 17px; }
.cookie-consent-card > p { margin-top: 10px; font-size: var(--fs-xs); line-height: 1.7; color: var(--muted-foreground); }
.cookie-consent-card > p a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.cookie-consent-options { display: grid; gap: 8px; margin-top: 14px; }
.cookie-consent-options[hidden] { display: none; }
.cookie-consent-option { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--background); cursor: pointer; }
.cookie-consent-option strong { display: block; font-size: var(--fs-xs); font-weight: var(--fw-semibold); line-height: 1.4; }
.cookie-consent-option small { display: block; margin-top: 3px; font-size: 11.5px; line-height: 1.6; color: var(--muted-foreground); }
.cookie-consent-option input { flex-shrink: 0; width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--brand); cursor: pointer; }
.cookie-consent-option input:disabled { opacity: .7; cursor: not-allowed; }
.cookie-consent-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.cookie-consent-actions .btn { height: 36px; padding: 0 16px; }
.cookie-consent-actions .btn[hidden] { display: none; }
.cookie-consent-manage { margin-left: auto; padding: 6px 0; border: 0; background: none; color: var(--foreground); font: inherit; font-size: var(--fs-xs); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media screen and (max-width: 700px) {
  .cookie-consent { left: 12px; bottom: 12px; width: calc(100vw - 24px); }
  .cookie-consent-card { padding: 18px; }
  .cookie-consent-actions .btn { flex: 1 1 130px; }
  .cookie-consent-manage { width: 100%; margin-left: 0; text-align: left; }
}
@media print { .cookie-consent { display: none; } }

/* ---- Footer additions and the policy page ---------------------------------- */
.footer-cookie-settings { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.footer-cookie-settings:hover { color: var(--foreground); }
.footer-owner a { display: inline-flex; align-items: center; border-radius: 4px; transition: opacity .2s; }
.footer-owner a:hover { opacity: .75; }
.policy-date { margin-top: 14px; font-size: var(--fs-xs); color: var(--muted-foreground); }
