/* Formularze OPS - mobile first. Motywy: light (biała karta), dark (ciemne tło landingu), warm (landing "mamy"). */
.ops-form-wrap {
  --of-text: #1f2328;
  --of-muted: #667085;
  --of-border: #cfd4dc;
  --of-input-bg: #fff;
  --of-accent: #d4a017;
  --of-ring: rgba(212, 160, 23, .32);
  --of-error: #c62828;
  --of-radius: 10px;
  color: var(--of-text);
  position: relative;
}
.ops-form-wrap[data-theme="dark"] {
  --of-text: #fff;
  --of-muted: rgba(255, 255, 255, .72);
  --of-border: rgba(255, 255, 255, .28);
  --of-input-bg: rgba(255, 255, 255, .08);
  --of-ring: rgba(255, 255, 255, .35);
  --of-error: #ff9c94;
}
.ops-form-wrap[data-theme="warm"] {
  --of-text: #4a3b32;
  --of-muted: #7e6a5e;
  --of-border: #e3d2c4;
  --of-accent: #c07a57;
  --of-ring: rgba(192, 122, 87, .3);
}

/* ---- karta: formularz sam jest białą kartą; w kartach szablonu (oferty, landingi) karta komponentu się wyłącza ---- */
.ops-form-wrap { background: #fff; border-radius: 16px; padding: 1.25rem; box-shadow: 0 12px 34px rgba(0, 0, 0, .14); }
@media (min-width: 576px) { .ops-form-wrap { padding: 1.75rem; } }
.ops-form-wrap[data-theme="dark"], .ops-form-wrap[data-theme="warm"],
:is(.bg-white, .form-wrap, .card-dark, .hero-card) > .ops-form-wrap { background: none; padding: 0; box-shadow: none; border-radius: 0; }
:is(.bg-white, .form-wrap, .card-dark, .hero-card) > .ops-form-wrap .ops-form-heading { display: none; }
.ops-form-heading { margin: 0 0 1.1rem; font-size: 1.2rem; font-weight: 700; line-height: 1.3; color: var(--of-text); }

/* ---- układ: jedna kolumna na telefonie, dwie od tabletu ---- */
.ops-form { display: block; margin: 0; }
.ops-fields { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 576px) {
  .ops-fields { grid-template-columns: 1fr 1fr; }
  .ops-field { grid-column: 1 / -1; }
  .ops-field--half { grid-column: auto; }
}
.ops-field { min-width: 0; }
.ops-field > label:not(.ops-check) { display: block; margin: 0 0 .35rem; font-size: .9rem; font-weight: 600; color: var(--of-text); }
.ops-req { color: var(--of-accent); font-weight: 700; }
[data-theme="dark"] .ops-req { color: #fff; }

/* ---- pola: min. 48 px wysokości (wygodne dotykanie), 16 px czcionki (iOS nie powiększa strony) ---- */
.ops-form input[type="text"], .ops-form input[type="email"], .ops-form input[type="tel"], .ops-form input[type="number"],
.ops-form select, .ops-form textarea {
  display: block; width: 100%; min-height: 48px; padding: .7rem .95rem;
  font: inherit; font-size: 1rem; line-height: 1.4; color: var(--of-text);
  background-color: var(--of-input-bg); border: 1.5px solid var(--of-border); border-radius: var(--of-radius);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
  -webkit-appearance: none; appearance: none;
}
.ops-form textarea { min-height: 112px; resize: vertical; }
.ops-form ::placeholder { color: var(--of-muted); opacity: .75; }
.ops-form select {
  padding-right: 2.6rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center;
}
[data-theme="dark"] .ops-form select option { color: #111; }
.ops-form input:focus, .ops-form select:focus, .ops-form textarea:focus {
  outline: none; border-color: var(--of-accent); box-shadow: 0 0 0 4px var(--of-ring);
}
[data-theme="dark"] .ops-form input:focus, [data-theme="dark"] .ops-form select:focus, [data-theme="dark"] .ops-form textarea:focus { border-color: #fff; }
.ops-form .is-invalid { border-color: var(--of-error); }
.ops-form .is-invalid:focus { box-shadow: 0 0 0 4px rgba(198, 40, 40, .18); }
.ops-error { margin-top: .35rem; font-size: .85rem; line-height: 1.35; color: var(--of-error); font-weight: 600; }
.ops-error::before { content: "⚠ "; }

/* ---- zgoda: duże pole do dotknięcia ---- */
.ops-consent { margin-top: 1.1rem; }
.ops-check { display: flex; gap: .75rem; align-items: flex-start; cursor: pointer; font-size: .875rem; line-height: 1.45; color: var(--of-muted); margin: 0; }
.ops-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ops-check-box {
  flex: none; width: 24px; height: 24px; margin-top: 1px; border: 1.5px solid var(--of-border); border-radius: 7px; background: var(--of-input-bg);
  display: inline-flex; align-items: center; justify-content: center; transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.ops-check-box::after {
  content: ""; width: 6px; height: 12px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) scale(0); margin-top: -2px; transition: transform .15s ease;
}
.ops-check input:checked + .ops-check-box { background: var(--of-accent); border-color: var(--of-accent); }
.ops-check input:checked + .ops-check-box::after { transform: rotate(45deg) scale(1); }
[data-theme="dark"] .ops-check input:checked + .ops-check-box { background: #fff; border-color: #fff; }
[data-theme="dark"] .ops-check input:checked + .ops-check-box::after { border-color: #111; }
.ops-check input:focus-visible + .ops-check-box { box-shadow: 0 0 0 4px var(--of-ring); }
.ops-check input.is-invalid + .ops-check-box { border-color: var(--of-error); }
.ops-check a { color: var(--of-accent); text-decoration: underline; }
[data-theme="dark"] .ops-check a { color: #fff; }

/* ---- przycisk wysyłki: pełna szerokość na telefonie, stan ładowania ---- */
.ops-submit { position: relative; width: 100%; margin-top: 1.25rem; min-height: 52px; }
.ops-spinner { display: none; width: 20px; height: 20px; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ops-spin .7s linear infinite; }
.ops-form.is-loading .ops-spinner { display: inline-block; }
.ops-form.is-loading .ops-submit { pointer-events: none; opacity: .85; }
@keyframes ops-spin { to { transform: rotate(360deg); } }
.ops-hint { margin: .75rem 0 0; font-size: .78rem; color: var(--of-muted); text-align: center; }

/* ---- komunikat błędu ogólnego ---- */
.ops-alert { margin-top: 1rem; padding: .85rem 1rem; border-radius: var(--of-radius); font-size: .95rem; line-height: 1.45; background: rgba(198, 40, 40, .09); border: 1.5px solid rgba(198, 40, 40, .45); color: var(--of-error); font-weight: 600; }
[data-theme="dark"] .ops-alert { background: rgba(255, 156, 148, .12); border-color: rgba(255, 156, 148, .5); }

/* ---- pułapka na boty ---- */
.ops-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---- ekran po wysłaniu ---- */
.ops-success { text-align: center; padding: 1.5rem .5rem; animation: ops-pop .45s cubic-bezier(.2, .8, .2, 1); }
.ops-success:focus { outline: none; }
.ops-success-title { margin: 1rem 0 .5rem; font-size: 1.35rem; font-weight: 700; color: var(--of-text); }
.ops-success-text { margin: 0 auto; max-width: 36ch; font-size: 1.05rem; line-height: 1.55; color: var(--of-text); opacity: .85; }
.ops-form-wrap.is-sent .ops-form-heading { display: none; }
.ops-check-anim { width: 76px; height: 76px; }
.ops-check-anim circle { stroke: var(--of-accent); stroke-dasharray: 151; stroke-dashoffset: 151; animation: ops-draw .6s ease forwards; }
.ops-check-anim path { stroke: var(--of-accent); stroke-dasharray: 40; stroke-dashoffset: 40; animation: ops-draw .4s ease .45s forwards; }
[data-theme="dark"] .ops-check-anim circle, [data-theme="dark"] .ops-check-anim path { stroke: #fff; }
@keyframes ops-draw { to { stroke-dashoffset: 0; } }
@keyframes ops-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

.ops-form-missing { padding: .75rem 1rem; border: 2px dashed #c62828; color: #c62828; border-radius: 8px; }

@media (prefers-reduced-motion: reduce) {
  .ops-success, .ops-check-anim circle, .ops-check-anim path, .ops-spinner { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* atrybut hidden musi wygrywać z display ustawionym wyżej */
.ops-form[hidden], .ops-success[hidden], .ops-alert[hidden], .ops-error[hidden] { display: none !important; }
