/* ==========================================================================
   Blok „Formularz kontaktowy” (.contact): temat steruje polami, przyciskiem i adresem (BOK / serwis).
   Źródło (prototyp): assets/css/style.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   Contact form (the chosen topic steers the fields, the button and the route)
   -------------------------------------------------------------------------- */

.contact { background: var(--paper-2); padding: clamp(4rem, 8vw, 7.5rem) 0; }
.contact__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-rows: auto 1fr; gap: 2.5rem clamp(2rem, 6vw, 6rem); align-items: start; }
.contact__intro { grid-column: 1; grid-row: 1; }
.contact__aside { grid-column: 1; grid-row: 2; }
.contact .form { grid-column: 2; grid-row: 1 / 3; }
.contact__intro h2 { margin: 0 0 1rem; max-width: 16ch; }
.contact__lead { color: var(--muted); font-size: 1.0625rem; max-width: 42ch; margin: 0; }
.contact__caption {
  font-family: var(--font-ui); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; margin: 0 0 1.1rem;
}
.next { list-style: none; margin: 0; padding: 0 0 0 2.25rem; display: grid; gap: 1.4rem; }
.next li { position: relative; }
.next li:not(:last-child)::before {
  content: ""; position: absolute; left: calc(-2.25rem + 6px); top: 22px; bottom: calc(-1.4rem - 2px);
  width: 2px; background: var(--orange-100);
}
.next__dot {
  position: absolute; left: -2.25rem; top: .25rem; width: 14px; height: 14px; border-radius: 50%;
  background: var(--paper-2); border: 2.5px solid var(--orange-100);
  transition: border-color .5s var(--ease), background .5s var(--ease), box-shadow .5s var(--ease);
}
.next li.is-lit .next__dot { border-color: var(--orange); background: var(--orange); box-shadow: 0 0 0 5px var(--orange-50); }
.next h3 { margin: 0 0 .15rem; font-size: 1.0625rem; font-weight: 600; color: var(--navy-900); }
.next p { margin: 0; font-size: .9375rem; color: var(--muted); max-width: 34ch; }
.contact__direct { margin: 2.5rem 0 0; font-size: .9375rem; color: var(--muted); display: flex; align-items: flex-start; gap: .6em; }
.contact__direct .icon { width: 1.2em; height: 1.2em; color: var(--orange-600); margin-top: .15em; }
.contact__direct b { font-weight: 500; color: var(--navy-900); }
.contact__direct a {
  color: var(--navy-900); font-family: var(--font-ui); font-weight: 600; font-size: 1rem; letter-spacing: -.01em;
  font-variant-numeric: tabular-nums; text-decoration: none; white-space: nowrap;
}
.contact__direct a:hover { text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 1.5px; text-underline-offset: .2em; }

.form { position: relative; min-width: 0; }
.topics { border: 0; padding: 0; margin: 0 0 2.25rem; min-width: 0; }
.topics legend {
  font-family: var(--font-ui); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; padding: 0; margin: 0 0 .85rem;
}
.topics__list { display: flex; flex-wrap: wrap; gap: .6rem; }
.topic { position: relative; }
.topic input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.topic span {
  display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--font-ui); font-weight: 500; font-size: .9375rem; line-height: 1; color: var(--navy-900);
  background: #fff; border: 1.5px solid var(--muted-2); border-radius: var(--radius-pill); padding: .8em 1.15em .8em .95em;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, box-shadow .3s var(--ease);
}
.topic span .icon { width: 1.15em; height: 1.15em; color: var(--navy); transition: color .2s; }
.topic:hover span { border-color: var(--navy); }
.topic input:checked + span { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.topic input:checked + span .icon { color: var(--orange-400); }
.topic input:focus-visible + span { outline: 2px solid var(--navy-900); outline-offset: 3px; }

.form__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 2rem; }
.field { display: grid; gap: .3rem; min-width: 0; align-content: start; }
.field--wide { grid-column: 1 / -1; }
.contact [hidden] { display: none !important; }
.field label {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  font-family: var(--font-ui); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; transition: color .2s;
}
.field label small { font-size: .6875rem; letter-spacing: .03em; text-transform: none; font-weight: 500; color: var(--muted); text-align: right; }
.field input, .field select, .field textarea {
  -webkit-appearance: none; appearance: none; width: 100%; min-width: 0; display: block;
  font: inherit; font-size: 1.0625rem; line-height: 1.4; color: var(--navy-900);
  background: transparent; border: 0; border-bottom: 1px solid var(--muted-2); border-radius: 0;
  padding: .5rem 0 .6rem; margin: 0; box-shadow: 0 1px 0 0 transparent;
  transition: border-color .2s, box-shadow .2s;
}
.field input:hover, .field select:hover, .field textarea:hover { border-bottom-color: var(--navy); }
.field textarea { resize: vertical; min-height: 6.25rem; }
.field select {
  padding-right: 1.75rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23234269' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .1rem center; background-size: 1.1rem;
}
.field select.is-empty { color: var(--muted); }
.field select option { color: var(--navy-900); }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 1; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  outline: none; border-bottom-color: var(--navy-900); box-shadow: 0 1px 0 0 var(--navy-900);
}
.field:focus-within label { color: var(--navy-900); }
.field__error { display: none; margin: .1rem 0 0; font-size: .8125rem; line-height: 1.4; color: var(--error); font-style: normal; }
.field.is-invalid label { color: var(--error); }
.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea { border-bottom-color: var(--error); box-shadow: 0 1px 0 0 var(--error); }
.field.is-invalid .field__error { display: block; }

.consent {
  display: grid; grid-template-columns: auto 1fr; gap: .8rem; align-items: start;
  margin: 1.75rem 0 0; font-size: .875rem; line-height: 1.5; color: var(--muted); cursor: pointer;
}
.consent input {
  -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin: .2rem 0 0;
  border: 1.5px solid var(--muted-2); border-radius: 2px; background: #fff; cursor: pointer;
  display: grid; place-content: center; transition: border-color .2s, background-color .2s;
}
.consent input::before {
  content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0;
  transform: rotate(-45deg) translate(1px, -1px); opacity: 0; transition: opacity .15s;
}
.consent input:checked { background: var(--navy-900); border-color: var(--navy-900); }
.consent input:checked::before { opacity: 1; }
.consent:hover input { border-color: var(--navy); }
.consent.is-invalid input { border-color: var(--error); box-shadow: 0 0 0 1px var(--error); }
.consent.is-invalid .field__error { display: block; margin-top: .25rem; }

.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; margin: 0; }

.form__footer { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: 2rem; }
.form__footer .btn span { display: inline-block; min-width: 0; }
.form__footer .btn[disabled] { opacity: .7; cursor: progress; transform: none; }
.form__route { margin: 0; font-size: .875rem; color: var(--muted); display: inline-flex; align-items: center; gap: .5em; }
.form__route .icon { width: 1.15em; height: 1.15em; color: var(--orange-600); }
.form__route b { font-weight: 500; color: var(--navy-900); }
.form__status { margin: 1rem 0 0; font-size: .9375rem; line-height: 1.5; color: var(--navy-900); max-width: 60ch; }
.form__status:empty { display: none; }
.form__status.is-error { color: var(--error); }

.form__done { padding: 2.5rem 0 1rem; max-width: 52ch; }
.form__done-icon {
  display: inline-grid; place-content: center; width: 48px; height: 48px; border-radius: 50%;
  background: var(--orange); color: var(--navy-900); margin-bottom: 1.25rem; box-shadow: 0 0 0 6px var(--orange-50);
}
.form__done-icon .icon { width: 1.5rem; height: 1.5rem; stroke-width: 2.25; }
.form__done h3 { margin: 0 0 .5rem; font-size: 1.5rem; font-weight: 600; color: var(--navy-900); }
.form__done p { margin: 0 0 1.5rem; color: var(--muted); }
.form__done p b { font-weight: 500; color: var(--navy-900); }
.form__done p a { color: var(--navy-900); font-family: var(--font-ui); font-weight: 600; text-decoration: none; white-space: nowrap; }
.form__done .link-more { background: none; border: 0; padding: 0; cursor: pointer; }
.form.is-sent .form__body { display: none; }

@media (max-width: 900px) {
  .contact__grid { grid-template-columns: 1fr; }
  .contact__intro h2 { max-width: 22ch; }
  .contact__grid { grid-template-rows: none; }
  .contact__intro, .contact__aside, .contact .form { grid-column: auto; grid-row: auto; }
  .contact__aside { order: 3; padding-top: .5rem; }
}

@media (max-width: 560px) {
  .form__grid { grid-template-columns: 1fr; }
  .form__footer .btn { flex: 1 1 100%; justify-content: center; }
  .topic span { font-size: .875rem; }
}

/* Stopka B nachodzi 44 px na sekcję kontaktu (assets/css/footer.css): sekcja ma o tyle więcej dołu.
   Prototyp: assets/css/stopka-b.css. */
.contact { padding-bottom: calc(clamp(4rem, 8vw, 7.5rem) + 44px); }
