/* ── Koper-ICT osTicket form — velden altijd donker, witte tekst ── */

html, body {
  --kp-form-accent:       #5CA1C7;
  --kp-form-overlay:      rgba(0, 0, 0, 0.35);
  --kp-form-overlay-box:  rgba(11, 16, 22, 0.78);
  --kp-form-border:       rgba(255, 255, 255, 0.16);
  --kp-form-spinner:      rgba(255, 255, 255, 0.22);
  --kp-form-spinner-top:  rgba(255, 255, 255, 0.85);
  --kp-form-feedback-bg:  rgba(0, 0, 0, 0.25);
  --kp-form-text:         var(--kp-text, #f5f7ff);
}

/* Light mode: alleen overlay/feedback aanpassen, velden blijven donker */
body.kp-theme-light, html.kp-theme-light {
  --kp-form-overlay:      rgba(200, 215, 230, 0.6);
  --kp-form-overlay-box:  rgba(238, 242, 247, 0.95);
  --kp-form-spinner-top:  rgba(0, 84, 126, 0.9);
  --kp-form-feedback-bg:  rgba(0, 84, 126, 0.06);
}
@media (prefers-color-scheme: light) {
  body:not(.kp-theme-dark):not(.kp-theme-light) {
    --kp-form-overlay:      rgba(200, 215, 230, 0.6);
    --kp-form-overlay-box:  rgba(238, 242, 247, 0.95);
    --kp-form-spinner-top:  rgba(0, 84, 126, 0.9);
    --kp-form-feedback-bg:  rgba(0, 84, 126, 0.06);
  }
}

/* ── Layout ── */
.koperict-osticket-form { width: 100%; max-width: none !important; position: relative; }
.koperict-osticket-form .koperict-field { display: block !important; width: 100% !important; margin: 0 0 1.1rem !important; }
.koperict-osticket-form label { display: block !important; width: 100% !important; margin: 0 0 .5rem !important; color: var(--kp-form-text); }

/* ── Velden: altijd donker met witte tekst ── */
.koperict-osticket-form input[type="text"],
.koperict-osticket-form input[type="email"],
.koperict-osticket-form input[type="tel"],
.koperict-osticket-form textarea,
.koperict-osticket-form select {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: .85rem 1rem !important;
  border-radius: calc(var(--kp-radius, 18px) - 6px) !important;
  border: 2px solid var(--kp-form-accent, #5CA1C7) !important;
  background: #2d3748 !important;
  color: #f5f7ff !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  color-scheme: dark !important;
  outline: none !important;
  transition: background 200ms ease, box-shadow 200ms ease;
}

.koperict-osticket-form textarea { min-height: 320px; resize: vertical; }

/* Placeholder — dark mode */
.koperict-osticket-form input[type="text"]::placeholder,
.koperict-osticket-form input[type="email"]::placeholder,
.koperict-osticket-form input[type="tel"]::placeholder,
.koperict-osticket-form textarea::placeholder {
  color: rgba(183, 224, 241, 0.6) !important;
  opacity: 1 !important;
}

/* Placeholder — light mode */
body.kp-theme-light .koperict-osticket-form input[type="text"]::placeholder,
body.kp-theme-light .koperict-osticket-form input[type="email"]::placeholder,
body.kp-theme-light .koperict-osticket-form input[type="tel"]::placeholder,
body.kp-theme-light .koperict-osticket-form textarea::placeholder,
html.kp-theme-light .koperict-osticket-form input[type="text"]::placeholder,
html.kp-theme-light .koperict-osticket-form input[type="email"]::placeholder,
html.kp-theme-light .koperict-osticket-form input[type="tel"]::placeholder,
html.kp-theme-light .koperict-osticket-form textarea::placeholder {
  color: rgba(0, 84, 126, 0.45) !important;
  opacity: 1 !important;
}
@media (prefers-color-scheme: light) {
  body:not(.kp-theme-dark):not(.kp-theme-light) .koperict-osticket-form input::placeholder,
  body:not(.kp-theme-dark):not(.kp-theme-light) .koperict-osticket-form textarea::placeholder {
    color: rgba(0, 84, 126, 0.45) !important;
  }
}

/* Focus */
.koperict-osticket-form input[type="text"]:focus,
.koperict-osticket-form input[type="email"]:focus,
.koperict-osticket-form input[type="tel"]:focus,
.koperict-osticket-form textarea:focus,
.koperict-osticket-form select:focus {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(92, 161, 199, 0.3) !important;
}

/* Select opties */
.koperict-osticket-form select option {
  background: #2d3748 !important;
  color: #f5f7ff !important;
}

/* Validatie */
.koperict-invalid { border-color: rgba(255, 94, 94, .85) !important; box-shadow: 0 0 0 3px rgba(255, 0, 0, .12) !important; }

/* ── Actions ── */
.koperict-actions { margin-top: .5rem; display: flex; flex-direction: column; gap: .75rem; align-items: flex-start; }
.koperict-submit[disabled] { opacity: .55; cursor: not-allowed; filter: grayscale(15%); }
.koperict-hint { font-size: .9rem; opacity: .9; }

/* Feedback */
.koperict-feedback {
  margin: 0 0 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--kp-border, rgba(255,255,255,.12));
  border-radius: calc(var(--kp-radius, 18px) - 6px);
  background: var(--kp-form-feedback-bg);
  color: var(--kp-form-text);
}

/* ── Sending overlay (inline) ── */
.kp-osticket-sending {
  display: none;
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: var(--kp-form-overlay);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px;
  z-index: 50;
}
.kp-osticket-sending .kp-osticket-sending-box {
  max-width: 520px;
  width: 100%;
  border-radius: 14px;
  background: var(--kp-form-overlay-box);
  border: 1px solid var(--kp-form-border);
  padding: 16px 18px;
  color: var(--kp-form-text);
}
.kp-osticket-sending .kp-osticket-sending-title { font-weight: 700; letter-spacing: .02em; margin-bottom: 6px; }
.kp-osticket-sending .kp-osticket-sending-sub { opacity: .9; font-size: .95rem; }
.kp-osticket-sending .kp-osticket-spinner {
  width: 22px; height: 22px;
  border: 3px solid var(--kp-form-spinner);
  border-top-color: var(--kp-form-spinner-top);
  border-radius: 50%;
  margin: 0 auto 10px;
  animation: kpSpin 0.9s linear infinite;
}
@keyframes kpSpin { to { transform: rotate(360deg); } }

.koperict-osticket-form.kp-is-sending .kp-osticket-sending { display: flex; }
.koperict-osticket-form.kp-is-sending .kp-osticket-fields { opacity: .25; pointer-events: none; }

/* ── Global sending overlay ── */
#kp-osticket-global-sending {
  position: fixed; inset: 0; z-index: 99990;
  display: none; align-items: center; justify-content: center; padding: 24px;
  background: var(--kp-form-overlay);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
#kp-osticket-global-sending .kp-box {
  max-width: 560px; width: 100%; border-radius: 16px;
  background: var(--kp-form-overlay-box);
  border: 1px solid var(--kp-form-border);
  padding: 18px 20px; text-align: center;
  color: var(--kp-form-text);
}
#kp-osticket-global-sending .kp-title { font-weight: 800; letter-spacing: .02em; margin-bottom: 6px; font-size: 1.05rem; }
#kp-osticket-global-sending .kp-sub { opacity: .9; font-size: .95rem; }
#kp-osticket-global-sending .kp-spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--kp-form-spinner);
  border-top-color: var(--kp-form-spinner-top);
  border-radius: 50%; margin: 0 auto 12px;
  animation: kpSpin 0.9s linear infinite;
}

.koperict-turnstile { margin: .25rem 0; }
