/*
 * Intake-modal (gedeeld via template-parts/intake-modal.php).
 *
 * Eén bron van waarheid voor de modal-styling. Wordt op elke pagina
 * enqueued via functions.php (hmi_enqueue_assets), zodat de modal die
 * footer.php op elke pagina rendert ook overal correct gestyled is.
 *
 * Voorheen stond deze CSS inline in page-home.php. Op pagina's zonder
 * inline modal-CSS (bedankt, diensten, case-*, kennisbank, aan-de-slag,
 * legal-pagina's) lekte de modal door als ongestylde markup in de
 * document-flow, met de groene corner-SVG op default-grootte. Dat is
 * met deze centralisatie opgelost.
 *
 * Crewbase-demo-modal (#hmiCrewbaseDemoModal) heeft eigen page-specifieke
 * styling die op crewbase + tarieven inline blijft staan; die deelt
 * deze basisregels en heeft er geen conflict mee.
 */

/* MODAL, HMI glassmorphism, warm cream palette */
.hmi-modal, .hmi-modal * { box-sizing: border-box; }
.hmi-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.4s ease; padding: clamp(16px, 3vw, 32px); font-family: var(--font-body); }
.hmi-modal.open { opacity: 1; pointer-events: auto; }
.hmi-modal-backdrop { position: absolute; inset: 0; background: rgba(26,24,22,0.78); backdrop-filter: blur(14px) saturate(120%); -webkit-backdrop-filter: blur(14px) saturate(120%); cursor: pointer; }
/* Dialog: solid warm cream surface, geen doorzichtige fill, anders kijkt de hero erdoor */
.hmi-modal-dialog { position: relative; background: #F9F5EE; color: var(--ink); max-width: 680px; width: 100%; max-height: 92vh; overflow-y: auto; border-radius: 20px; padding: clamp(56px, 6vw, 72px) clamp(28px, 4vw, 56px) clamp(28px, 4vw, 44px); box-shadow: 0 32px 80px -16px rgba(26,24,22,0.55), 0 0 0 1px rgba(31,92,66,0.2), inset 0 1px 0 rgba(255,255,255,0.7); transform: translateY(20px) scale(0.98); transition: transform 0.5s cubic-bezier(.2,.8,.2,1); border: 1px solid rgba(31,92,66,0.18); }
.hmi-modal.open .hmi-modal-dialog { transform: translateY(0) scale(1); }
/* Subtiele champagne glow accent rechtsboven, decoratief, achter content */
.hmi-modal-dialog::before { content: ""; position: absolute; top: 0; right: 0; width: 60%; height: 50%; background: radial-gradient(ellipse at top right, rgba(31,92,66,0.18), transparent 70%); border-radius: 20px 20px 0 0; pointer-events: none; z-index: 0; }
.hmi-modal-dialog::after { content: ""; position: absolute; top: 0; left: 5%; right: 5%; height: 2px; background: linear-gradient(90deg, rgba(31,92,66,0) 0%, rgba(31,92,66,0.55) 30%, rgba(46,139,97,0.85) 50%, rgba(31,92,66,0.55) 70%, rgba(31,92,66,0) 100%); border-radius: 0 0 4px 4px; pointer-events: none; z-index: 2; }
.hmi-modal.open .hmi-modal-dialog { box-shadow: 0 32px 80px -16px rgba(26,24,22,0.55), 0 0 0 1px rgba(31,92,66,0.32), 0 0 0 6px rgba(31,92,66,0.06), inset 0 1px 0 rgba(255,255,255,0.7); }
.hmi-modal-dialog > * { position: relative; z-index: 1; }
.hmi-modal-dialog::-webkit-scrollbar { width: 6px; }
.hmi-modal-dialog::-webkit-scrollbar-track { background: transparent; }
.hmi-modal-dialog::-webkit-scrollbar-thumb { background: rgba(26,24,22,0.18); border-radius: 999px; }

.hmi-modal-close { position: absolute; top: clamp(14px, 1.5vw, 20px); right: clamp(14px, 1.5vw, 20px); width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-strong); background: rgba(255,255,255,0.85); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-size: 22px; line-height: 1; color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.3s, color 0.3s, transform 0.4s cubic-bezier(.2,.8,.2,1), border-color 0.3s; z-index: 2; }
.hmi-modal-close:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); transform: rotate(90deg); }
.hmi-modal-close:focus-visible { outline: 2px solid var(--champagne); outline-offset: 2px; }

.hmi-modal-head { margin-top: 4px; margin-bottom: clamp(24px, 3vw, 32px); padding-right: 48px; }
.hmi-modal-head .hmi-eyebrow {
  margin-bottom: 18px;
  color: var(--champagne);
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.28em;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 12px;
  background: rgba(31,92,66,0.10);
  border: 1px solid rgba(31,92,66,0.28);
  border-radius: 999px;
  text-transform: uppercase;
}
.hmi-modal-head .hmi-eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--champagne);
  box-shadow: 0 0 10px rgba(31,92,66,0.6);
  animation: hmi-modal-eyebrow-pulse 2.5s ease-in-out infinite;
}
@keyframes hmi-modal-eyebrow-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.75); }
}
.hmi-modal-head h3 { font-family: var(--font-display); font-weight: 600; font-size: clamp(26px, 3.2vw, 38px); line-height: 1.08; letter-spacing: -0.03em; margin: 0 0 12px; color: var(--ink); }
.hmi-modal-head h3 em { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--champagne); text-shadow: 0 0 24px rgba(31,92,66,0.22); }
.hmi-modal-sub { font-family: var(--font-body); color: var(--ink-soft); font-size: clamp(14px, 1.05vw, 15px); line-height: 1.6; max-width: 480px; margin: 0; }

.hmi-modal-form { display: flex; flex-direction: column; gap: clamp(14px, 1.6vw, 18px); font-family: var(--font-body); }
.hmi-modal-form label { display: flex; flex-direction: column; gap: 8px; font-family: var(--font-body); }
.hmi-modal-form label > span { font-family: var(--font-body); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
/* Inputs: identical font-family, warme tint, gold border on focus */
/* Specificiteit-bump met [type] + !important op visuele props: zonder dit
 * winnen GeneratePress' input-resets bij gelijke specificiteit en hadden
 * de eerste 3 velden (Naam/E-mail/Bedrijf) geen border, terwijl textarea
 * (geen UA-reset op die tag) wel correct toonde. */
.hmi-modal-form input,
.hmi-modal-form input[type],
.hmi-modal-form select,
.hmi-modal-form textarea {
  font-family: var(--font-body) !important;
  font-size: clamp(14px, 1.05vw, 15px) !important;
  padding: 13px 16px !important;
  border: 1px solid rgba(26,24,22,0.14) !important;
  border-radius: 10px !important;
  background: #FFFCF6 !important;
  color: var(--ink) !important;
  outline: none !important;
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s !important;
  appearance: none;
  -webkit-appearance: none;
  width: 100% !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
  letter-spacing: 0 !important;
  box-shadow: none !important;
}
.hmi-modal-form input::placeholder,
.hmi-modal-form textarea::placeholder { color: var(--soft); font-weight: 400; opacity: 1; font-family: var(--font-body); }
.hmi-modal-form input:hover,
.hmi-modal-form input[type]:hover,
.hmi-modal-form select:hover,
.hmi-modal-form textarea:hover { border-color: rgba(26,24,22,0.28) !important; background: #fff !important; }
.hmi-modal-form input:focus,
.hmi-modal-form input[type]:focus,
.hmi-modal-form select:focus,
.hmi-modal-form textarea:focus {
  border-color: var(--champagne) !important;
  background: #fff !important;
  box-shadow: 0 0 0 4px rgba(31,92,66,0.15) !important;
}
.hmi-modal-form.submitted input:invalid,
.hmi-modal-form.submitted textarea:invalid { border-color: rgba(198,40,40,0.45); }
.hmi-modal-form textarea { resize: vertical; min-height: 110px; line-height: 1.55; }

/* Bottom row, submit knop hoort er duidelijk bij, niet los */
.hmi-form-bottom {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: clamp(12px, 1.5vw, 18px);
  gap: 20px;
  flex-wrap: wrap;
}
.hmi-form-note { font-family: var(--font-body); font-size: 13px; color: var(--ink-soft); line-height: 1.5; max-width: 340px; }
.hmi-form-note a { color: var(--champagne); transition: color 0.3s; font-weight: 500; }
.hmi-form-note a:hover { color: var(--champagne-hover); }

/* .hmi-form-reassurance is een crewbase-demo-specifiek voet-blok (geen
 * creditcard / geen opstartkost / stopzetten). Hier in shared CSS zodat
 * de gedeelde crewbase-demo-modal-template overal correct toont. */
.hmi-form-reassurance { font-family: var(--font-body); font-size: 12px; color: var(--ink-soft); margin: 14px 0 0; line-height: 1.55; opacity: 0.85; }
.hmi-form-status { min-height: 0; font-family: var(--font-body); font-size: 13px; margin: 0; line-height: 1.4; padding-left: 14px; position: relative; }
.hmi-form-status.success { color: var(--champagne); }
.hmi-form-status.success::before { content: "●"; position: absolute; left: 0; top: 1px; color: var(--champagne); animation: hmi-modal-eyebrow-pulse 1.6s ease-in-out infinite; }
.hmi-form-status.error { color: #c62828; }
.hmi-modal-form .hmi-btn-dark { background: var(--champagne); color: var(--bg); box-shadow: 0 14px 32px -10px rgba(31,92,66,0.45), 0 2px 6px -2px rgba(31,92,66,0.18); transition: background 0.4s cubic-bezier(.2,.8,.2,1), box-shadow 0.4s cubic-bezier(.2,.8,.2,1), transform 0.4s cubic-bezier(.2,.8,.2,1); }
.hmi-modal-form .hmi-btn-dark:hover { background: var(--champagne-hover); transform: translateY(-2px); box-shadow: 0 22px 48px -14px rgba(31,92,66,0.55), 0 4px 12px -2px rgba(31,92,66,0.22); }
.hmi-modal-close { transition: background 0.35s, color 0.35s, border-color 0.35s, transform 0.4s cubic-bezier(.2,.8,.2,1); }
.hmi-modal-close:hover { background: var(--champagne); color: var(--bg); border-color: var(--champagne); transform: rotate(90deg); box-shadow: 0 0 0 6px rgba(31,92,66,0.12); }

@media (max-width: 720px) {
  .hmi-modal { padding: 12px; align-items: flex-end; }
  .hmi-modal-dialog { border-radius: 18px 18px 14px 14px; max-height: 94vh; }
  .hmi-modal.open .hmi-modal-dialog { transform: translateY(0); }
  .hmi-form-bottom { flex-direction: column; align-items: stretch; }
  .hmi-form-bottom .hmi-btn { justify-content: center; width: 100%; }
  .hmi-form-note { text-align: center; max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .hmi-modal,
  .hmi-modal-dialog,
  .hmi-modal-close { transition: opacity 0.2s; }
  .hmi-modal-close:hover { transform: none; }
}
