/**
 * OES — Contact Form 7 (klasy .oes-form)
 * Wymaga włączonej wtyczki OES Site.
 */

.oes-kb.oes-kb--contact {
  --oes-kb-max: min(100%, 70rem);
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 2rem) 0.75rem clamp(2rem, 4vw, 2.75rem);
  box-sizing: border-box;
  font-family: var(--oes-font, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  color: var(--oes-ink, #0a0a0a);
}

.oes-kb.oes-kb--contact .oes-kb__inner {
  max-width: var(--oes-kb-max);
  margin: 0 auto;
}

/* Układ 1/3 tekst + 2/3 formularz */
.oes-kb.oes-kb--contact .oes-kb-contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: clamp(1rem, 2.5vw, 1.5rem);
  align-items: start;
}

.oes-kb.oes-kb--contact .oes-kb-contact-aside {
  padding: 0.15rem 0.25rem 0;
}

.oes-kb.oes-kb--contact .oes-kb-contact-aside__title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.2rem, 2.6vw, 1.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.oes-kb.oes-kb--contact .oes-kb-contact-aside__lead {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--oes-muted, #5c5c5c);
}

.oes-kb.oes-kb--contact .oes-kb-contact-aside__list {
  margin: 0 0 0.85rem;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.oes-kb.oes-kb--contact .oes-kb-contact-aside__list li {
  position: relative;
  padding-left: 0.85rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--oes-muted, #5c5c5c);
}

.oes-kb.oes-kb--contact .oes-kb-contact-aside__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--oes-blue, #0054bb);
}

.oes-kb.oes-kb--contact .oes-kb-contact-aside__list strong {
  color: var(--oes-ink, #0a0a0a);
  font-weight: 700;
}

.oes-kb.oes-kb--contact .oes-kb-contact-aside__note {
  margin: 0;
  padding: 0.55rem 0.7rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--oes-muted, #5c5c5c);
  background: rgba(0, 84, 187, 0.06);
  border: 1px solid rgba(0, 84, 187, 0.12);
  border-radius: 10px;
  border-left: 3px solid var(--oes-blue, #0054bb);
}

.oes-kb.oes-kb--contact .oes-form-panel {
  padding: clamp(0.75rem, 1.8vw, 1rem) clamp(0.85rem, 1.8vw, 1rem);
  background: linear-gradient(160deg, rgba(0, 84, 187, 0.07) 0%, rgba(0, 84, 187, 0.025) 100%);
  border: 1px solid rgba(0, 84, 187, 0.14);
  border-radius: 16px;
  box-shadow: 0 2px 14px rgba(10, 10, 10, 0.04);
}

/* CF7 — zeruj domyślne odstępy motywu / wtyczki */
.oes-kb.oes-kb--contact .wpcf7 {
  margin: 0;
}

.oes-kb.oes-kb--contact .wpcf7-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
}

.oes-kb.oes-kb--contact .wpcf7-form p,
.oes-kb.oes-kb--contact .oes-form p {
  margin: 0 !important;
  padding: 0 !important;
}

.oes-kb.oes-kb--contact .wpcf7-form p.oes-form__actions,
.oes-kb.oes-kb--contact .oes-form p.oes-form__actions {
  padding-top: 1.35rem !important;
}

.oes-kb.oes-kb--contact .wpcf7-form br {
  display: none;
}

.oes-kb.oes-kb--contact .wpcf7-form-control-wrap {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}

/* CF7 — elementy ukryte w domyślnym CSS wtyczki (wyłączony przez oes-site) */
.oes-kb.oes-kb--contact .hidden-fields-container,
.oes-kb.oes-kb--contact fieldset.hidden-fields-container {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

.oes-kb.oes-kb--contact .wpcf7-honeypot,
.oes-kb.oes-kb--contact .hp-message,
.oes-kb.oes-kb--contact .wpcf7-form-control-wrap.honeypot {
  display: none !important;
  visibility: hidden !important;
  position: absolute !important;
  left: -9999px !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

.oes-kb.oes-kb--contact .wpcf7-response-output:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

.oes-kb.oes-kb--contact .screen-reader-response {
  position: absolute;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
}

.oes-form {
  margin: 0;
}

.oes-form__row {
  display: grid;
  gap: 0.4rem 0.55rem;
  margin: 0;
}

.oes-form__row--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.oes-form__field {
  margin: 0;
}

.oes-form__field > label {
  display: block;
  margin: 0 0 0.12rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--oes-ink, #0a0a0a);
  letter-spacing: 0.01em;
}

.oes-form__req {
  color: var(--oes-red, #b83d40);
  font-weight: 800;
}

.oes-form__optional {
  font-weight: 500;
  color: var(--oes-muted, #5c5c5c);
}

.oes-form__input,
.oes-form__select,
.oes-form__textarea,
.oes-kb.oes-kb--contact .wpcf7-form-control-wrap input[type="text"],
.oes-kb.oes-kb--contact .wpcf7-form-control-wrap input[type="email"],
.oes-kb.oes-kb--contact .wpcf7-form-control-wrap input[type="tel"],
.oes-kb.oes-kb--contact .wpcf7-form-control-wrap select,
.oes-kb.oes-kb--contact .wpcf7-form-control-wrap textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  min-height: 2.75rem;
  padding: 0.55rem 0.65rem;
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--oes-ink, #0a0a0a);
  background: #fff;
  border: 1px solid var(--oes-line, #e5e5e5);
  border-radius: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.oes-form__select,
.oes-kb.oes-kb--contact .wpcf7-form-control-wrap select {
  cursor: pointer;
  appearance: none;
  padding-right: 2rem;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235c5c5c' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 10px 6px;
}

.oes-form__textarea,
.oes-kb.oes-kb--contact .wpcf7-form-control-wrap textarea {
  min-height: 5.5rem;
  max-height: 10rem;
  resize: vertical;
}

.oes-form__textarea::placeholder,
.oes-kb.oes-kb--contact .wpcf7-form-control-wrap textarea::placeholder {
  color: #6b6b6b;
  font-size: 0.86rem;
}

.oes-form__input:focus,
.oes-form__select:focus,
.oes-form__textarea:focus,
.oes-kb.oes-kb--contact .wpcf7-form-control-wrap input:focus,
.oes-kb.oes-kb--contact .wpcf7-form-control-wrap select:focus,
.oes-kb.oes-kb--contact .wpcf7-form-control-wrap textarea:focus {
  outline: none;
  border-color: var(--oes-blue, #0054bb);
  box-shadow: 0 0 0 2px rgba(0, 84, 187, 0.12);
}

.oes-kb.oes-kb--contact .wpcf7-not-valid-tip {
  margin-top: 0.15rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--oes-red, #b83d40);
}

.oes-kb.oes-kb--contact .wpcf7 form.invalid .wpcf7-response-output,
.oes-kb.oes-kb--contact .wpcf7 form.unaccepted .wpcf7-response-output,
.oes-kb.oes-kb--contact .wpcf7 form.failed .wpcf7-response-output {
  margin: 0.35rem 0 0 !important;
  padding: 0.5rem 0.65rem !important;
  font-size: 0.78rem;
  line-height: 1.4;
  border-radius: 8px;
  border: 1px solid rgba(184, 61, 64, 0.35);
  background: rgba(184, 61, 64, 0.08);
  color: var(--oes-ink, #0a0a0a);
}

.oes-kb.oes-kb--contact .wpcf7 form.sent .wpcf7-response-output {
  margin: 0.35rem 0 0 !important;
  padding: 0.5rem 0.65rem !important;
  font-size: 0.78rem;
  line-height: 1.4;
  border-radius: 8px;
  border: 1px solid rgba(0, 84, 187, 0.25);
  background: rgba(0, 84, 187, 0.08);
  color: var(--oes-ink, #0a0a0a);
}

.oes-form__field--rodo {
  display: block;
  margin: 0.35rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--oes-line, #e5e5e5);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.5;
  color: #4a4a4a;
}

.oes-form__field--rodo::after {
  content: "";
  display: table;
  clear: both;
}

.oes-form__field--rodo .wpcf7-list-item {
  display: inline;
  margin: 0;
}

.oes-form__field--rodo label {
  display: block;
  margin: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.oes-form__field--rodo input[type="checkbox"] {
  float: left;
  width: 1.1rem;
  height: 1.1rem;
  min-width: 1.1rem;
  min-height: 1.1rem;
  margin: 0.18em 0.55em 0 0;
  accent-color: var(--oes-blue, #0054bb);
  cursor: pointer;
}

.oes-form__field--rodo a {
  color: var(--oes-blue, #0054bb);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.oes-form__field--rodo a:hover {
  color: var(--oes-red, #b83d40);
}

.oes-form__actions {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin: 0 !important;
  padding-top: 1.35rem !important;
}

.oes-form__note {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--oes-muted, #5c5c5c);
  text-align: center;
}

.oes-kb.oes-kb--contact .wpcf7 form.sent .wpcf7-response-output a {
  color: var(--oes-blue, #0054bb);
  font-weight: 700;
}

.oes-form__submit,
.oes-kb.oes-kb--contact .wpcf7-submit,
.oes-kb.oes-kb--contact input.oes-form__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  min-width: 2.75rem;
  padding: 0.55rem 1.25rem;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  color: #fff !important;
  background: var(--oes-red, #b83d40) !important;
  border: 2px solid var(--oes-red, #b83d40) !important;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(184, 61, 64, 0.22);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.oes-form__submit:hover,
.oes-kb.oes-kb--contact .wpcf7-submit:hover,
.oes-kb.oes-kb--contact input.oes-form__submit:hover {
  background: #a23538 !important;
  border-color: #a23538 !important;
  transform: translateY(-1px);
}

.oes-form__submit:focus-visible,
.oes-kb.oes-kb--contact .wpcf7-submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 84, 187, 0.25);
}

.oes-kb.oes-kb--contact .wpcf7-spinner {
  margin-left: 0.4rem;
  vertical-align: middle;
}

@media (max-width: 768px) {
  .oes-kb.oes-kb--contact .oes-kb-contact-layout {
    grid-template-columns: 1fr;
  }

  .oes-form__row--2 {
    grid-template-columns: 1fr;
  }
}
