/* ═══════════════════════════════════════════════════════════════
   Formularz kontaktowy MDM Labs — style wspólne (prefiks .kf-).

   Używany przez: kontakt.html, uslugi.html.
   Jeden formularz, jedno źródło stylów — zmiana tutaj zmienia
   wygląd na WSZYSTKICH stronach, które go osadzają.

   Zakłada zmienne z :root strony (--red, --white, --radius-card …)
   oraz fonty Montserrat + DM Sans.
   ═══════════════════════════════════════════════════════════════ */

/* ─── HERO KONTAKTU ─────────────────────────────────────────── */
@keyframes kfFadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

.kf-page {
  background: var(--black);
  min-height: 100vh;
  padding-top: var(--nav-h);
  position: relative;
  overflow: hidden;
}
.kf-page__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}
.kf-page__orb {
  position: absolute; top: -140px; right: -140px;
  width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, rgba(238,49,55,0.14) 0%, transparent 68%);
  pointer-events: none;
}
.kf-inner {
  position: relative; z-index: 1;
  max-width: 900px; margin: 0 auto;
  padding: 64px 24px 96px;
}

.kf-hero { text-align: center; margin-bottom: 44px; animation: kfFadeUp 0.7s ease both; }
.kf-hero__eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'Montserrat', sans-serif; font-weight: 700;
  font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--red); margin-bottom: 18px;
}
.kf-hero__eyebrow::before,
.kf-hero__eyebrow::after {
  content: ''; width: 28px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(238,49,55,0.7));
}
.kf-hero__eyebrow::after { background: linear-gradient(90deg, rgba(238,49,55,0.7), transparent); }
.kf-hero__title {
  font-family: 'Montserrat', sans-serif; font-weight: 900;
  font-size: clamp(2rem, 5.2vw, 3.2rem); line-height: 1.1;
  letter-spacing: -0.03em; color: var(--white);
}
.kf-hero__title span { color: var(--red); }
.kf-hero__sub {
  margin: 18px auto 0; max-width: 620px;
  font-size: 1.02rem; line-height: 1.7; color: rgba(255,255,255,0.58);
}
.kf-hero__points {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 10px 20px; margin-top: 24px;
}
.kf-hero__point {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.82rem; color: rgba(255,255,255,0.55);
}
.kf-hero__point svg { width: 14px; height: 14px; color: var(--red); flex-shrink: 0; }

/* ─── KARTA FORMULARZA ──────────────────────────────────────── */
.kf-card {
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: var(--radius-card);
  box-shadow: 0 30px 80px rgba(0,0,0,0.55);
  padding: 32px;
  animation: kfFadeUp 0.7s 0.1s ease both;
}

/* Pasek postępu */
.kf-progress { margin-bottom: 30px; }
.kf-progress__meta {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: 'Montserrat', sans-serif; font-weight: 700;
  font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase;
  margin-bottom: 12px;
}
.kf-progress__step  { color: var(--red); }
.kf-progress__label { color: rgba(255,255,255,0.42); text-align: right; }
.kf-progress__track {
  height: 4px; border-radius: 4px; overflow: hidden;
  background: rgba(255,255,255,0.08);
}
.kf-progress__bar {
  height: 100%; width: 25%; border-radius: 4px;
  background: linear-gradient(90deg, #EE3137, #FF7A7E);
  box-shadow: 0 0 12px rgba(238,49,55,0.5);
  transition: width 0.45s cubic-bezier(0.4,0,0.2,1);
}

.kf-step { display: none; animation: kfFadeUp 0.42s ease both; }
.kf-step.is-active { display: block; }
.kf-step__head { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.kf-step__badge {
  font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 0.72rem;
  color: var(--red); background: rgba(238,49,55,0.12);
  border: 1px solid rgba(238,49,55,0.3);
  padding: 4px 12px; border-radius: var(--radius-pill); flex-shrink: 0;
}
.kf-step__title {
  font-family: 'Montserrat', sans-serif; font-weight: 800;
  font-size: 1.35rem; letter-spacing: -0.02em; color: var(--white);
}

/* ─── POLA ──────────────────────────────────────────────────── */
.kf-field { margin-bottom: 26px; }
.kf-field:last-of-type { margin-bottom: 0; }
.kf-label {
  display: block; margin-bottom: 10px;
  font-size: 0.92rem; font-weight: 500; color: rgba(255,255,255,0.85); line-height: 1.5;
}
.kf-label .kf-req { color: var(--red); margin-left: 3px; }

.kf-input, .kf-textarea {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: 'DM Sans', sans-serif; font-size: 0.95rem; line-height: 1.6;
  padding: 13px 16px;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.kf-textarea { min-height: 116px; resize: vertical; }
.kf-input::placeholder, .kf-textarea::placeholder { color: rgba(255,255,255,0.28); }
.kf-input:focus, .kf-textarea:focus {
  outline: none; border-color: rgba(238,49,55,0.6);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 0 0 3px rgba(238,49,55,0.14);
}
.kf-input.is-invalid, .kf-textarea.is-invalid { border-color: rgba(238,49,55,0.85); }

.kf-help {
  margin-top: 8px; font-size: 0.8rem; color: rgba(255,255,255,0.36); line-height: 1.55;
}
.kf-example { margin-top: 8px; }
.kf-example > summary {
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; list-style: none;
  font-size: 0.78rem; font-weight: 500; color: rgba(238,49,55,0.85);
}
.kf-example > summary::-webkit-details-marker { display: none; }
.kf-example > summary::before { content: '＋'; font-size: 0.9rem; line-height: 1; }
.kf-example[open] > summary::before { content: '−'; }
.kf-example p {
  margin-top: 8px; padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border-left: 2px solid rgba(238,49,55,0.5);
  border-radius: 0 8px 8px 0;
  font-size: 0.82rem; line-height: 1.65; color: rgba(255,255,255,0.5);
}

.kf-error {
  display: block; min-height: 18px; margin-top: 7px;
  font-size: 0.78rem; font-weight: 500; color: #FF6B70;
}

/* ─── CHIPSY (wybór jedno- i wielokrotny) ───────────────────── */
.kf-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.kf-chip {
  font-family: 'DM Sans', sans-serif; font-size: 0.88rem;
  color: rgba(255,255,255,0.72);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: var(--radius-pill);
  padding: 10px 18px; cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}
.kf-chip:hover { background: rgba(255,255,255,0.08); color: var(--white); }
.kf-chip:focus-visible { outline: 2px solid rgba(238,49,55,0.8); outline-offset: 2px; }
.kf-chip[aria-pressed="true"] {
  background: rgba(238,49,55,0.16); border-color: var(--red);
  color: var(--white); font-weight: 500;
}
.kf-chips--grid .kf-chip { flex: 0 1 auto; }

/* ─── ZGODA ─────────────────────────────────────────────────── */
.kf-consent {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px; margin-top: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.kf-consent input {
  width: 18px; height: 18px; margin-top: 2px;
  accent-color: var(--red); flex-shrink: 0; cursor: pointer;
}
.kf-consent span { font-size: 0.84rem; line-height: 1.6; color: rgba(255,255,255,0.6); }
.kf-consent a { color: var(--red); text-decoration: underline; }

/* Honeypot — niewidoczny dla ludzi, kuszący dla botów. */
.kf-hp {
  position: absolute; left: -9999px; width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}

/* ─── NAWIGACJA KROKÓW ──────────────────────────────────────── */
.kf-actions {
  display: flex; align-items: center; gap: 12px;
  margin-top: 30px; padding-top: 26px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
/* Atrybut [hidden] daje display:none tylko z domyślnego arkusza przeglądarki,
   więc każde nasze `display` go pokonuje. Bez tej reguły przyciski „Wstecz"
   i „Wyślij" (display:inline-flex) sterczały na wszystkich krokach. */
[hidden] { display: none !important; }

.kf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: 'Montserrat', sans-serif; font-weight: 700;
  font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 15px 30px; border-radius: var(--radius-pill);
  border: none; cursor: pointer; white-space: nowrap;
  transition: transform 0.3s, box-shadow 0.3s, background 0.3s, opacity 0.3s;
}
.kf-btn svg { width: 16px; height: 16px; }
.kf-btn--primary {
  flex: 1; background: var(--red); color: var(--white);
  box-shadow: 0 6px 22px rgba(238,49,55,0.34);
}
.kf-btn--primary:hover:not(:disabled) {
  background: #d4262b; transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(238,49,55,0.46);
}
.kf-btn--primary:disabled { opacity: 0.55; cursor: not-allowed; }
.kf-btn--ghost {
  background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.62);
  border: 1px solid rgba(255,255,255,0.13);
}
.kf-btn--ghost:hover { background: rgba(255,255,255,0.1); color: var(--white); }

.kf-note {
  margin-top: 16px; text-align: center;
  font-size: 0.78rem; color: rgba(255,255,255,0.34);
}
.kf-formerror {
  margin-top: 16px; padding: 12px 16px; border-radius: var(--radius-sm);
  background: rgba(238,49,55,0.1); border: 1px solid rgba(238,49,55,0.32);
  color: #FF8C90; font-size: 0.85rem; line-height: 1.55;
}
.kf-turnstile { margin-top: 22px; display: flex; justify-content: center; }

/* ─── EKRAN POTWIERDZENIA ───────────────────────────────────── */
.kf-success { text-align: center; padding: 30px 8px; }
.kf-success__icon {
  width: 72px; height: 72px; margin: 0 auto 22px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(238,49,55,0.12); border: 1px solid rgba(238,49,55,0.35);
  color: var(--red); font-size: 2rem;
}
.kf-success__title {
  font-family: 'Montserrat', sans-serif; font-weight: 800;
  font-size: 1.6rem; color: var(--white); margin-bottom: 12px;
}
.kf-success__sub {
  max-width: 460px; margin: 0 auto 26px;
  font-size: 0.95rem; line-height: 1.7; color: rgba(255,255,255,0.55);
}

/* ─── DANE KONTAKTOWE ───────────────────────────────────────── */
/* Jeden duży panel w stylu karty formularza — nie trzy osobne kafelki. */
.kf-details {
  margin-top: 28px;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: var(--radius-card);
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
  padding: 30px 34px;
  display: grid; grid-template-columns: repeat(3, 1fr);
}
.kf-detail {
  padding: 2px 28px;
  border-left: 1px solid rgba(255,255,255,0.09);
}
.kf-detail:first-child { border-left: none; padding-left: 0; }
.kf-detail:last-child  { padding-right: 0; }
.kf-detail__label {
  font-family: 'Montserrat', sans-serif; font-weight: 700;
  font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.38); margin-bottom: 10px;
}
.kf-detail__value {
  font-size: 1.02rem; font-weight: 500; color: var(--white); word-break: break-word;
}
a.kf-detail__value:hover { color: var(--red); }
.kf-detail__meta { margin-top: 8px; font-size: 0.8rem; color: rgba(255,255,255,0.4); }

.kf-faq { margin-top: 56px; }
.kf-faq__title {
  font-family: 'Montserrat', sans-serif; font-weight: 800;
  font-size: 1.3rem; color: var(--white); margin-bottom: 20px;
}
.kf-faq__item {
  border-top: 1px solid rgba(255,255,255,0.08); padding: 18px 0;
}
.kf-faq__q {
  font-family: 'Montserrat', sans-serif; font-weight: 700;
  font-size: 0.95rem; color: var(--white); margin-bottom: 8px;
}
.kf-faq__a { font-size: 0.9rem; line-height: 1.7; color: rgba(255,255,255,0.52); }

/* Panel danych kontaktowych: 3 kolumny → 1, pionowe kreski zamieniamy
   na poziome, żeby podział pozostał czytelny po zwinięciu. */
@media (max-width: 760px) {
  .kf-details { grid-template-columns: 1fr; padding: 24px 26px; }
  .kf-detail {
    padding: 18px 0;
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.09);
  }
  .kf-detail:first-child { border-top: none; padding-top: 0; }
  .kf-detail:last-child  { padding-bottom: 0; }
}

@media (max-width: 640px) {
  .kf-inner { padding: 40px 16px 72px; }
  .kf-card  { padding: 22px 18px; border-radius: var(--radius-panel); }
  .kf-actions { flex-direction: column-reverse; }
  .kf-btn { width: 100%; }
  .kf-progress__label { display: none; }
}
