/*
Theme Name: Kabelmot
Description: Strona Kabelmot: katalog instalacji elektrycznych do zabytkowych pojazdów. Wygląd C z makiety propozycji 2026-10-12.
Version: 1.0
Requires PHP: 8.1
Text Domain: kabelmot
*/

/* Everything visual lives in assets/site.css, which started as a copy of the look C mockup's styles.css
   (../../../strona/propozycje-2026-10-12/projekty/c-premium/) and is developed here from now on, fonts included
   (assets/fonts/). This file maps the CF7 markup onto it. */

/* Contact form: CF7 renders form "Kontakt" (seed.php) with the mockup's markup, so .formularz, .pole and
   .formularz-stopka come from site.css. These rules map CF7's own wrappers and states onto C's colours. */
:root {
  --blad: #9b2c1f; /* błąd na papierze: 7,3:1 */
}

.wpcf7 .hidden-fields-container,
.wpcf7-spinner,
.wpcf7-response-output {
  display: none;
}

.wpcf7-form-control-wrap {
  display: block;
}

/* in the mockup the textarea is a flex item of .pole (block); inline inside CF7's wrap it leaves a 10 px line gap under it */
.wpcf7-form-control-wrap > textarea {
  display: block;
}

/* the submit is an <input>, which site.css stretches to the field width; on a phone the button is full width, as in the mockup */
@media (min-width: 760px) {
  .formularz .wpcf7-submit {
    width: auto;
  }
}

.formularz .wpcf7-submit:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* Fields with an error: red line and message under the field */
.pole [aria-invalid='true'] {
  border-color: var(--blad);
  box-shadow: 0 2px 0 var(--blad);
}

.pole textarea[aria-invalid='true'] {
  box-shadow: inset 0 0 0 1px var(--blad);
}

.wpcf7-not-valid-tip {
  display: block;
  margin-top: 8px;
  color: var(--blad);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.35;
}

/* The error summary is CF7's list for screen readers: hidden until a submit fails validation, then a red panel
   above the form (inside the card) */
.wpcf7 .screen-reader-response {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.wpcf7:has(form.invalid) .screen-reader-response {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
  white-space: normal;
  margin-bottom: 24px;
  padding: 16px 20px;
  background: #fff;
  border: 1px solid var(--blad);
  border-left-width: 4px;
  border-radius: 2px;
  color: var(--tusz);
}

.wpcf7 .screen-reader-response p {
  margin: 0 0 4px;
  font-weight: 700;
  color: var(--blad);
}

.wpcf7 .screen-reader-response ul {
  margin: 0;
  padding-left: 20px;
}

/* Sent: the success panel from the form markup (.formularz-wyslany, seed.php; site.js puts in the address and
   focuses it) replaces the fields, in the section's own type */
.formularz-wyslany,
.wpcf7 form.sent > :not(.formularz-wyslany) {
  display: none;
}

.wpcf7 form.sent {
  display: block;
}

.wpcf7 form.sent .formularz-wyslany {
  display: block;
  padding-left: 20px;
  border-left: 4px solid var(--mosiadz-ciemny);
  color: var(--tusz-2);
}

.formularz-wyslany-tytul {
  margin-bottom: 8px;
  font: 300 32px/1.3 var(--s);
  color: var(--tusz);
}

.formularz-adres {
  overflow-wrap: anywhere;
  font-weight: 600;
  color: var(--tusz);
}

/* A form without the panel (the old seed still in the DB, or the client removed it in Kontakt > Formularze): CF7's
   own message instead, in the panel's place and type */
.wpcf7 form.sent:not(:has(.formularz-wyslany)) .wpcf7-response-output {
  display: block;
  margin: 0;
  padding-left: 20px;
  border-left: 4px solid var(--mosiadz-ciemny);
  font: 300 28px/1.3 var(--f);
  color: var(--tusz);
}

/* Not saved or sent (mail error, spam, aborted): the message under the button */
.wpcf7 form:is(.failed, .aborted, .spam) .wpcf7-response-output {
  display: block;
  grid-column: 1 / -1;
  padding: 16px 20px;
  background: #fff;
  border: 1px solid var(--blad);
  border-left-width: 4px;
  border-radius: 2px;
  color: var(--tusz);
  font-weight: 600;
}
