/* Contact Form 7 — the only CF7 stylesheet (the plugin's own styles.css is dequeued in functions.php).
   Forms carry the design markup (.form-grid / .field / .consent / .chips / .btn), so the design CSS
   styles the fields; this file only maps CF7's wrappers and states onto the design tokens. */

/* ---- CF7 internals the plugin CSS used to cover ---- */
.wpcf7 .screen-reader-response {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); white-space: nowrap;
}
.wpcf7 .hidden-fields-container { display: none; }
.wpcf7 [inert] { opacity: 0.5; }
.wpcf7 input[type="url"], .wpcf7 input[type="email"], .wpcf7 input[type="tel"] { direction: ltr; }
.wpcf7 .wpcf7-submit:disabled { cursor: not-allowed; opacity: 0.6; }

/* ---- layout: CF7 wrappers must not change the design grid ---- */
.wpcf7-form { position: relative; }
.form .wpcf7-form { display: grid; gap: 18px; }
.wpcf7-form-control-wrap { position: relative; display: block; }
.wpcf7-form input.wpcf7-submit.btn { -webkit-appearance: none; appearance: none; }

/* ---- validation ---- */
/* (invalid field look: see 'Fields' below) */
.wpcf7-not-valid-tip { display: block; margin-top: 6px; font-size: 0.875rem; font-weight: 600; line-height: 1.4; color: var(--danger); }

/* ---- consent checkbox (design .consent) ---- */
.consent .wpcf7-list-item { display: block; margin: 0; }
.consent .wpcf7-list-item label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; cursor: pointer; }
.consent .wpcf7-list-item input[type="checkbox"] { flex: none; margin: 2px 0 0; }
.consent .wpcf7-list-item-label { font-weight: 400; }
.consent .wpcf7-list-item-label a { display: inline; min-height: 0; }

/* ---- choice chips (design .chip) ---- */
.chips .wpcf7-form-control { display: block; }
.chips .wpcf7-list-item { display: inline-flex; margin: 0 6px 8px 0; }
.chips .wpcf7-list-item label { position: relative; display: inline-flex; cursor: pointer; }
.chips .wpcf7-list-item input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; padding: 0; }
.chips .wpcf7-list-item-label {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px;
  border: 1.5px solid var(--ink-muted); border-radius: 999px; font-weight: 600;
  transition: background-color 160ms ease-out, border-color 160ms ease-out, color 160ms ease-out;
}
.chips input:checked + .wpcf7-list-item-label { background: var(--accent); border-color: var(--accent); color: var(--bg, #fff); }
.chips input:focus-visible + .wpcf7-list-item-label { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---- spinner: overlays the form corner, never adds a grid row ---- */
.wpcf7-spinner {
  visibility: hidden; position: absolute; right: 12px; bottom: 12px; margin: 0; padding: 0;
  width: 24px; height: 24px; border: 0; border-radius: 50%; background: var(--accent); opacity: 0.8;
}
.wpcf7-form.submitting .wpcf7-spinner { visibility: visible; }
.wpcf7-spinner::before {
  content: ""; position: absolute; top: 4px; left: 4px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--surface); transform-origin: 8px 8px; animation: dk-cf7-spin 1000ms linear infinite;
}
@keyframes dk-cf7-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .wpcf7-spinner::before { animation: none; } }

/* ---- response message ---- */
.wpcf7 form .wpcf7-response-output {
  margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  font-size: 0.9375rem; font-weight: 600; color: var(--ink);
}
.wpcf7 form.init .wpcf7-response-output,
.wpcf7 form.resetting .wpcf7-response-output,
.wpcf7 form.submitting .wpcf7-response-output { display: none; }
.wpcf7 form.sent .wpcf7-response-output { border-color: var(--accent); background: var(--surface); color: var(--accent); }
.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output,
.wpcf7 form.payment-required .wpcf7-response-output,
.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.aborted .wpcf7-response-output,
.wpcf7 form.spam .wpcf7-response-output {
  border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--bg, #fff)); color: var(--danger);
}

/* ---- Fields: clean, flat, no glow ----
   No box-shadow halo on focus or error. Focus = accent border + 1px accent outline
   (a crisp 2px edge, still a visible keyboard ring), error = danger border.
   :not(.dk-b) x4 beats the boosted design rules in dermaklinika.el.css. */
.field :is(input, select, textarea):not(.dk-b):not(.dk-b):not(.dk-b):not(.dk-b) {
  min-height: 52px; padding: 13px 16px;
  border: 1px solid var(--field-line); border-radius: 10px;
  background-color: var(--bg); color: var(--ink); box-shadow: none;
  font-size: 1.0625rem; line-height: 1.4;
  transition: border-color 150ms ease-out;
}
.field textarea:not(.dk-b):not(.dk-b):not(.dk-b):not(.dk-b) { min-height: 128px; resize: vertical; }
.field :is(input, textarea):not(.dk-b):not(.dk-b):not(.dk-b):not(.dk-b)::placeholder { color: var(--ink-muted); opacity: 0.7; }
.field :is(input, select, textarea):hover:not(.dk-b):not(.dk-b):not(.dk-b):not(.dk-b) { border-color: var(--accent); }
.field :is(input, select, textarea):is(:focus, :focus-visible):not(.dk-b):not(.dk-b):not(.dk-b):not(.dk-b) {
  border-color: var(--accent); outline: 1px solid var(--accent); outline-offset: 0; box-shadow: none;
}
.field :is(input, select, textarea):is(.wpcf7-not-valid, [aria-invalid="true"]):not(.dk-b):not(.dk-b):not(.dk-b):not(.dk-b),
.field.is-invalid :is(input, select, textarea):not(.dk-b):not(.dk-b):not(.dk-b):not(.dk-b) { border-color: var(--danger); box-shadow: none; }
.field :is(input, select, textarea).wpcf7-not-valid:focus:not(.dk-b):not(.dk-b):not(.dk-b):not(.dk-b) { outline-color: var(--danger); }
/* chips + consent: same outline language instead of the halo */
.chip input:focus-visible + span:not(.dk-b):not(.dk-b):not(.dk-b):not(.dk-b) { box-shadow: none; outline: 2px solid var(--accent); outline-offset: 2px; }
.consent input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .field :is(input, select, textarea):not(.dk-b):not(.dk-b):not(.dk-b):not(.dk-b) { transition: none; } }
