/* =========================================================================
   panels.css — komponenty wspólne dla strony głównej i /reservations/.
   Zawiera tylko to, czego faktycznie używają obie strony:
     1) panel przebiegu procesu (karty kroków + animowany łącznik),
     2) hero z panelem obok tekstu,
     3) panel kontaktowy — układ i sposób prezentacji wzorca z Lead Dashboardu.
   NIE jest dołączany przez /lead_dashboard/ (ta strona zostaje przy swoim
   styles.css — jest wzorcem, nie kopiujemy z niego całego arkusza).
   Kolory biorą się z akcentu strony, więc panel jest spójny z identyfikacją
   każdej strony bez dopisywania osobnych palet.
   ========================================================================= */

/* =========================================================================
   1. PANEL PRZEBIEGU PROCESU
   Diagram realnego przebiegu — celowo nie udaje zrzutu interfejsu.
   --panel-accent pozwala podać akcent produktu, gdy panel stoi w karcie
   produktu (strona główna); domyślnie bierze akcent strony.
   ========================================================================= */
.flow-card {
  --panel-accent: var(--accent);
  --panel-accent-tint: rgba(255, 255, 255, 0.05);
  margin: 0;
  padding: clamp(16px, 1.6vw, 22px);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
  box-shadow: 0 26px 60px -34px rgba(0, 0, 0, 0.95);
}
/* strona Reservations: bursztynowy oddech w panelu */
.is-reservations .flow-card { --panel-accent-tint: rgba(227, 161, 94, 0.12); }

.flow-card .fc-kicker {
  display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--panel-accent);
}
.flow-card .fc-title {
  display: block; margin-top: 6px; font-size: 1.02rem; font-weight: 600; color: var(--text);
}
.flow-card > .fc-title:first-child { margin-top: 0; }
.flow-card .fc-note {
  margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 0.8rem; color: var(--muted);
}

.flow { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.flow li {
  position: relative;
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center; gap: 10px;
  padding: 9px 12px 9px 8px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-3); color: var(--soft); font-size: 0.88rem;
}
.flow .fl-dot {
  display: grid; place-items: center;
  width: 20px; height: 20px; justify-self: center; border-radius: 50%;
  border: 1px solid var(--panel-accent);
  background: rgba(0, 0, 0, 0.25); color: var(--panel-accent);
  font-size: 0.66rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.flow .fl-tag {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap;
}
/* krok, w którym decyduje człowiek — jedyny wyróżniony punkt przebiegu */
.flow li.is-hitl {
  border-color: var(--panel-accent);
  background: linear-gradient(90deg, var(--panel-accent-tint), transparent 65%), var(--bg-3);
  color: var(--text);
}
.flow li.is-hitl .fl-tag { color: var(--panel-accent); }

/* Animowany łącznik między krokami — wzór i tempo z Lead Dashboardu
   (styles.css: .mini path → stroke-dasharray: 3 3, animation: miniFlow 2.6s
   linear infinite, stroke-dashoffset: -12). To dokładnie 6 px wzoru pokonywane
   w 1,3 s, czyli ~4,6 px/s: ruch ciągły, liniowy, bez przyspieszania. */
.flow li:not(:last-child)::after {
  content: ""; position: absolute; left: 19px; top: 100%; width: 1px; height: 10px;
  background-image: linear-gradient(to bottom, var(--panel-accent) 0 3px, transparent 3px 6px);
  background-size: 1px 6px; background-repeat: repeat-y;
  animation: flowDown 1.3s linear infinite;
  opacity: 0.55;
}
@keyframes flowDown { to { background-position: 0 6px; } }
/* Ten sam czas i easing, przesunięte w czasie o 0,16 s na krok: kreska wędruje
   przez przebieg jako jedna fala zamiast mrugać na wszystkich łącznikach razem. */
.flow li:nth-child(2)::after { animation-delay: 0.16s; }
.flow li:nth-child(3)::after { animation-delay: 0.32s; }
.flow li:nth-child(4)::after { animation-delay: 0.48s; }
.flow li:nth-child(5)::after { animation-delay: 0.64s; }
.flow li:nth-child(6)::after { animation-delay: 0.8s; }
.flow li:nth-child(7)::after { animation-delay: 0.96s; }
.flow li:nth-child(8)::after { animation-delay: 1.12s; }

/* Ten sam łącznik w układzie poziomym — kroki „Proces w praktyce” na stronie
   głównej i na /reservations/. */
@media (min-width: 1001px) {
  .steps li:not(:last-child)::after {
    content: ""; position: absolute; top: 35px; left: 56px; right: -16px; height: 1px;
    background-image: linear-gradient(to right, var(--accent) 0 3px, transparent 3px 6px);
    background-size: 6px 1px; background-repeat: repeat-x;
    animation: flowRight 1.3s linear infinite;
    opacity: 0.55;
  }
  .steps li:nth-child(2)::after { animation-delay: 0.16s; }
  .steps li:nth-child(3)::after { animation-delay: 0.32s; }
  .steps li:nth-child(4)::after { animation-delay: 0.48s; }
}
@keyframes flowRight { to { background-position: 6px 0; } }

/* =========================================================================
   2. HERO Z PANELEM OBOK TEKSTU (układ stosowany na /reservations/)
   ========================================================================= */
.hero-split .hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
  text-align: left;
  justify-items: start;
}
/* Kolumna tekstowa jako siatka — bez tego nagłówek i tekst wprowadzający
   stykają się (poza .hero-inner nie ma już odstępów siatki). */
.hero-split .hero-copy { display: grid; gap: 20px; justify-items: start; max-width: 58ch; }
.hero-split h1 { max-width: 24ch; }
.hero-split .hero-sub { max-width: 56ch; }
.hero-split .hero-actions { justify-content: flex-start; margin-top: 26px; }
@media (max-width: 1000px) {
  .hero-split .hero-inner { grid-template-columns: 1fr; gap: 30px; }
  .hero-split .hero-copy, .hero-split h1, .hero-split .hero-sub { max-width: none; }
}

/* =========================================================================
   3. PANEL KONTAKTOWY
   Odtworzony układ i sposób prezentacji panelu z Lead Dashboardu
   (formularz w karcie + karta z krokami po wysłaniu + karta z adresem mail).
   Wspólne cechy: czytelny podział pól, wyraźny fokus, duży przycisk,
   numerowane kroki. Kolory idą za akcentem strony.
   ========================================================================= */
.contact-grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 18px;
  align-items: start;
}
.contact-grid .form {
  display: block;
  padding: clamp(20px, 2.2vw, 26px);
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-grid .field { margin-bottom: 15px; }
.contact-grid .field label {
  display: block; margin-bottom: 6px; font-size: 0.87rem; font-weight: 600; color: var(--soft);
}
/* gwiazdka oznaczająca pole wymagane — w kolorze akcentu strony */
.contact-grid .field label span[aria-hidden="true"] { color: var(--accent); }

.contact-grid .field input:not([type="checkbox"]),
.contact-grid .field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font: inherit;
  font-size: 0.94rem;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}
.contact-grid .field textarea { resize: vertical; min-height: 118px; line-height: 1.58; }
.contact-grid .field input::placeholder,
.contact-grid .field textarea::placeholder { color: #6c788a; }
/* Wyraźny fokus: obwódka w kolorze akcentu danej strony (zawsze widoczna). */
.contact-grid .field input:not([type="checkbox"]):focus,
.contact-grid .field textarea:focus {
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.32);
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.contact-grid .field.has-error input,
.contact-grid .field.has-error textarea { border-color: #e56b6b; }
.contact-grid .error { margin-top: 6px; font-size: 0.82rem; color: #f08c8c; }

/* Pole zgody: własny kwadrat wyboru (jak we wzorcu), z wyraźnym stanem zaznaczenia. */
.contact-grid .field--check {
  display: grid; grid-template-columns: 20px 1fr; gap: 11px; align-items: start; margin-bottom: 8px;
}
.contact-grid .field--check input {
  appearance: none; -webkit-appearance: none;
  width: 20px; height: 20px; margin: 2px 0 0; padding: 0;
  border: 1px solid var(--line-2); border-radius: 6px;
  background: rgba(0, 0, 0, 0.25); cursor: pointer; position: relative;
}
.contact-grid .field--check input:checked { background: var(--accent); border-color: var(--accent); }
.contact-grid .field--check input:checked::after {
  content: "✓"; position: absolute; inset: 0; display: grid; place-items: center;
  color: #0b0f14; font-size: 0.8rem; font-weight: 700;
}
.contact-grid .field--check input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.contact-grid .field--check label {
  margin: 0; font-size: 0.85rem; font-weight: 400; color: var(--soft); line-height: 1.5;
}

.btn-lg { padding: 14px 24px; font-size: 0.97rem; }
.btn-block { width: 100%; }
.contact-grid .form .btn-block { margin-top: 14px; }
.contact-grid .form-status { margin-top: 14px; font-size: 0.88rem; line-height: 1.55; }
.contact-grid .form .fine { margin-top: 12px; }

/* Karta obok formularza */
.contact-side { display: grid; gap: 16px; }
.panel-card {
  padding: 22px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.22s ease, background-color 0.22s ease;
}
/* Hover zmienia kolor obwódki i tło — bez przesuwania elementu. */
.panel-card:hover { border-color: var(--line-2); background: var(--bg-3); }
.panel-card-lg { padding: 26px; }
.mini-head {
  margin: 0 0 14px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
}

.next-steps { display: grid; gap: 14px; margin: 0 0 16px; padding: 0; list-style: none; }
.next-steps li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; }
.next-steps span {
  display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--accent);
  background: rgba(0, 0, 0, 0.25);
  color: var(--accent);
  font-size: 0.78rem; font-weight: 700;
}
.next-steps strong { display: block; font-size: 0.92rem; font-weight: 600; color: var(--text); }
.next-steps p { margin-top: 3px; font-size: 0.85rem; color: var(--muted); line-height: 1.5; }
.next-steps li > div { font-size: 0.88rem; color: var(--soft); line-height: 1.55; }

.contact-direct .mail-intro { margin: 0; font-size: 0.9rem; color: var(--soft); }
.contact-direct .mail-link {
  display: inline-block;
  margin: 12px 0 3px;
  font-size: 1.06rem; font-weight: 600; letter-spacing: -0.01em;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}
.contact-direct .mail-link:hover { color: var(--text); }
.contact-direct .fine { margin-top: 10px; }

/* Sekcje z czterema oknami — dokładnie 2 kolumny × 2 wiersze: 2 okna w górnym
   rzędzie, 2 w dolnym, bez układu 3+1. Wiersze mają równą wysokość, a odstęp
   jest taki sam w obu sekcjach (home: kompetencje, reservations: „Co daje
   restauracji?”). Używane wyłącznie przez .auto-grid--2, więc sekcja
   „Co automatyzujemy?” zostaje bez zmian. Na wąskich ekranach — jedna kolumna. */
.auto-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;              /* górny i dolny rząd tej samej wysokości */
  gap: 16px;                        /* ten sam odstęp poziomy i pionowy */
}
@media (max-width: 620px) {
  .auto-grid--2 { grid-template-columns: 1fr; grid-auto-rows: auto; }
}

@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .form-row { grid-template-columns: 1fr; } }

/* Ograniczenie ruchu: animacja łączników wyłączona, gdy użytkownik tego chce.
   (main.js i brand.css respektują to ustawienie — tu dopełniamy dla nowych reguł.) */
@media (prefers-reduced-motion: reduce) {
  .flow li:not(:last-child)::after,
  .steps li:not(:last-child)::after { animation: none; }
  .panel-card { transition: border-color 0.22s ease; }
  .panel-card:hover { background: var(--bg-2); }
}
