/*
 * Forms, modal windows and cookie consent
 * ----------------------------------------
 * This stylesheet is intentionally loaded after the legacy theme stylesheet.
 * All form rules are scoped to .tak-form so they cannot change unrelated site
 * blocks and do not depend on Contact Form 7's generated paragraph markup.
 */

:root {
  --tak-accent: #ffb30e;
  --tak-accent-hover: #e89d00;
  --tak-text: #171717;
  --tak-muted: #667085;
  --tak-border: #cfd4dc;
  --tak-border-hover: #98a2b3;
  --tak-surface: #ffffff;
  --tak-error: #b42318;
  --tak-success: #067647;
  --tak-focus: rgba(255, 179, 14, 0.25);
  --tak-radius: 10px;
}

.tak-form-section,
.tak-form-section *,
.popup,
.popup *,
.cookie-consent,
.cookie-consent * {
  box-sizing: border-box;
}

.tak-form-section {
  min-width: 0;
}

.tak-form-section .wpcf7,
.tak-form-section .wpcf7-form,
.tak-form {
  width: 100%;
  min-width: 0;
}

.tak-form {
  color: var(--tak-text);
  font: inherit;
  container-name: tak-form;
  container-type: inline-size;
}

.tak-form p,
.tak-form .wpcf7-form-control-wrap {
  margin: 0;
}

.tak-form .wpcf7-form-control-wrap {
  display: block;
  width: 100%;
}

.tak-form__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  width: 100%;
}

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

.tak-form__grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tak-form__field {
  display: block;
  min-width: 0;
  margin: 0;
}

.tak-form__field > label {
  display: block;
  margin: 0;
}

.tak-form__field--full {
  grid-column: 1 / -1;
}

.tak-form__label {
  display: block;
  margin: 0 0 7px;
  color: var(--tak-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.tak-form__required {
  color: var(--tak-error);
}

.tak-form input[type="text"],
.tak-form input[type="email"],
.tak-form input[type="tel"],
.tak-form input[type="date"],
.tak-form input[type="number"],
.tak-form select,
.tak-form textarea {
  display: block;
  width: 100%;
  max-width: none;
  min-height: 52px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--tak-border);
  border-radius: var(--tak-radius);
  outline: 0;
  background: var(--tak-surface);
  color: var(--tak-text);
  font: inherit;
  font-size: 16px;
  line-height: 1.35;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
  -webkit-appearance: none;
  appearance: none;
}

.tak-form input[type="date"] {
  padding: 12px 14px;
  color-scheme: light;
}

.tak-form select {
  padding-right: 44px;
  background-image: linear-gradient(45deg, transparent 50%, #667085 50%),
    linear-gradient(135deg, #667085 50%, transparent 50%);
  background-position: calc(100% - 19px) 22px, calc(100% - 14px) 22px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
}

.tak-form textarea {
  min-height: 132px;
  resize: vertical;
}

.tak-form input::placeholder,
.tak-form textarea::placeholder {
  color: #858d9b;
  opacity: 1;
}

.tak-form input:hover,
.tak-form select:hover,
.tak-form textarea:hover {
  border-color: var(--tak-border-hover);
}

.tak-form input:focus,
.tak-form select:focus,
.tak-form textarea:focus {
  border-color: var(--tak-accent);
  box-shadow: 0 0 0 4px var(--tak-focus);
}

.tak-form .wpcf7-not-valid {
  border-color: var(--tak-error) !important;
}

.tak-form .wpcf7-not-valid:focus {
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.14);
}

.tak-form .wpcf7-not-valid-tip {
  display: block;
  margin-top: 6px;
  color: var(--tak-error);
  font-size: 13px;
  line-height: 1.35;
}

.tak-form__footer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  align-items: center;
  gap: 18px;
  width: 100%;
  margin-top: 20px;
}

.tak-form__consent {
  min-width: 0;
  color: #344054;
  font-size: 14px;
  line-height: 1.45;
}

.tak-form__consent .wpcf7-list-item {
  display: block;
  margin: 0;
}

.tak-form__consent label {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin: 0;
  cursor: pointer;
}

.tak-form__consent input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin: 2px 0 0;
  padding: 0;
  accent-color: var(--tak-accent-hover);
  cursor: pointer;
}

.tak-form__consent a {
  color: #9a6700;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.tak-form__consent a:hover {
  color: #6f4a00;
}

.tak-form__security {
  width: 100%;
  min-width: 0;
}

.tak-turnstile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 65px;
  overflow: visible;
}

.tak-turnstile[data-widget-size="compact"] {
  min-height: 140px;
}

.tak-turnstile iframe {
  max-width: 100%;
}

.tak-form__security-note {
  margin: 5px 0 0 !important;
  color: var(--tak-muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}

.tak-form__actions {
  position: relative;
  display: flex;
  grid-column: -2 / -1;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.tak-form .tak-form__submit,
.tak-form input[type="submit"].tak-form__submit,
.tak-form button.tak-form__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: none;
  min-height: 52px;
  margin: 0;
  padding: 12px 20px;
  border: 1px solid var(--tak-accent);
  border-radius: var(--tak-radius);
  background: var(--tak-accent);
  color: #171717;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  -webkit-appearance: none;
  appearance: none;
}

.tak-form .tak-form__submit:hover {
  border-color: var(--tak-accent-hover);
  background: var(--tak-accent-hover);
}

.tak-form .tak-form__submit:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px var(--tak-focus);
}

.tak-form .tak-form__submit:active {
  transform: translateY(1px);
}

.tak-form .tak-form__submit:disabled {
  border-color: #e4e7ec;
  background: #e4e7ec;
  color: #98a2b3;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.tak-form .wpcf7-spinner {
  flex: 0 0 auto;
  margin: 8px 0 0 10px;
  vertical-align: middle;
}

.tak-form__actions .wpcf7-spinner {
  position: absolute;
  top: 50%;
  right: 10px;
  margin: 0;
  transform: translateY(-50%);
}

.tak-form-section .wpcf7 form .wpcf7-response-output {
  margin: 16px 0 0;
  padding: 11px 14px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  color: #344054;
  font-size: 14px;
  line-height: 1.4;
}

.tak-form-section .wpcf7 form.sent .wpcf7-response-output {
  border-color: #75e0a7;
  background: #ecfdf3;
  color: var(--tak-success);
}

.tak-form-section .wpcf7 form.invalid .wpcf7-response-output,
.tak-form-section .wpcf7 form.unaccepted .wpcf7-response-output,
.tak-form-section .wpcf7 form.spam .wpcf7-response-output,
.tak-form-section .wpcf7 form.failed .wpcf7-response-output,
.tak-form-section .wpcf7 form.aborted .wpcf7-response-output {
  border-color: #fda29b;
  background: #fef3f2;
  color: var(--tak-error);
}

/* Accessible modal windows. Legacy class names stay in place for old links. */
body.tak-modal-open {
  overflow: hidden;
}

.popup {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  width: auto;
  height: 100vh;
  height: 100dvh;
  padding: 20px;
  overflow: auto;
  background: rgba(18, 18, 18, 0.82);
  overscroll-behavior: contain;
}

.popup.is-open {
  display: flex;
}

.popup[aria-hidden="true"] {
  display: none;
}

.popup .popup-container {
  position: relative;
  width: min(100%, 560px);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: clamp(24px, 4vw, 38px);
  overflow: auto;
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  scrollbar-gutter: stable;
}

.popup.popup-call__content-2 .popup-container {
  width: min(100%, 680px);
}

.popup.popup-calc__content .popup-container {
  width: min(100%, 980px);
}

.popup .popup-call,
.popup.popup-calc__content .popup-container .popup-call {
  position: static;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  background: transparent;
}

.popup .form,
.popup .tariff-text__calculator {
  width: 100%;
  margin: 0;
  padding: 0;
}

.popup .form > .container,
.popup.popup-call__content .popup-container .form > .container,
.popup.popup-call__content-2 .popup-container .form > .container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  background: transparent;
}

.popup.popup-call__content .popup-container .container .section-title,
.popup.popup-call__content-2 .popup-container .container .section-title,
.popup.popup-calc__content .tariff-text__calculator--title {
  margin: 0 52px 22px 0;
  color: var(--tak-text);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
}

.popup .close,
.popup.popup-calc__content .close,
.popup.popup-call__content .popup-container .close,
.popup.popup-call__content-2 .popup-container .close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  max-width: 42px;
  height: 42px;
  min-height: 42px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f2f4f7;
  color: #344054;
  font-family: Arial, sans-serif;
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.popup .close:hover {
  background: #e4e7ec;
  color: #101828;
}

.popup .close:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px var(--tak-focus);
}

.popup:not(.popup-calc__content) .tak-form__grid,
.popup:not(.popup-calc__content) .tak-form__grid--2,
.popup:not(.popup-calc__content) .tak-form__grid--3,
.popup:not(.popup-calc__content) .tak-form__footer {
  grid-template-columns: minmax(0, 1fr);
}

.popup:not(.popup-calc__content) .tak-form__footer {
  gap: 16px;
}

.popup:not(.popup-calc__content) .tak-form__actions {
  justify-content: stretch;
}

/* Cookie consent: compact card on desktop, stacked controls on small screens. */
.cookie-consent[hidden] {
  display: none !important;
}

.cookie-consent {
  position: fixed;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 16px;
  z-index: 100000;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: #171717;
  color: #fff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.cookie-consent__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
}

.cookie-consent__text {
  margin: 0;
  color: #fff;
  font-size: 15px;
  line-height: 1.45;
}

.cookie-consent__text a {
  color: #ffd273;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-consent__actions {
  display: flex;
  gap: 10px;
}

.cookie-consent .cookie-consent__button {
  width: auto;
  max-width: none;
  min-width: 128px;
  min-height: 44px;
  margin: 0;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.cookie-consent__button--primary {
  background: var(--tak-accent);
  color: #171717;
}

.cookie-consent__button--primary:hover {
  background: var(--tak-accent-hover);
}

.cookie-consent__button--secondary {
  border-color: #667085 !important;
  background: transparent;
  color: #fff;
}

.cookie-consent__button--secondary:hover {
  border-color: #98a2b3 !important;
  background: #2b2b2b;
}

.cookie-consent__button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Review form from Strong Testimonials: safe, minimal normalization. */
.strong-form input[type="text"],
.strong-form input[type="email"],
.strong-form input[type="tel"],
.strong-form textarea,
.strong-form select {
  width: 100%;
  max-width: none;
  min-height: 50px;
  margin: 0;
  padding: 11px 14px;
  border: 1px solid var(--tak-border);
  border-radius: var(--tak-radius);
  background: #fff;
  color: var(--tak-text);
  font: inherit;
  font-size: 16px;
}

.strong-form textarea {
  min-height: 130px;
  resize: vertical;
}

.strong-form input[type="submit"],
.strong-form button[type="submit"] {
  width: auto;
  max-width: none;
  min-height: 50px;
  padding: 11px 22px;
  border-radius: var(--tak-radius);
  background: var(--tak-accent);
  color: #171717;
  font-weight: 700;
}

@media (max-width: 980px) {
  .tak-form__grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .tak-form__grid--2,
  .tak-form__grid--3,
  .tak-form__footer,
  .tak-form--calculator .tak-form__footer,
  .popup.popup-calc__content .tak-form__grid--2,
  .popup.popup-calc__content .tak-form__footer {
    grid-template-columns: minmax(0, 1fr);
  }

  .tak-form__consent {
    grid-column: auto;
  }

  .tak-form__actions {
    grid-column: auto;
    justify-content: stretch;
  }

  .popup {
    align-items: flex-start;
    padding: 10px;
  }

  .popup .popup-container {
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    padding: 24px 18px;
    border-radius: 12px;
  }

  .popup.popup-call__content .popup-container .container .section-title,
  .popup.popup-call__content-2 .popup-container .container .section-title,
  .popup.popup-calc__content .tariff-text__calculator--title {
    margin-right: 44px;
    margin-bottom: 20px;
  }

  .popup .close,
  .popup.popup-calc__content .close {
    top: 10px;
    right: 10px;
    width: 38px;
    max-width: 38px;
    height: 38px;
    min-height: 38px;
    font-size: 27px;
  }

  .cookie-consent {
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    width: calc(100% - 20px);
    padding: 14px;
  }

  .cookie-consent__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 13px;
  }

  .cookie-consent__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cookie-consent .cookie-consent__button {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 380px) {
  .tak-form__grid,
  .tak-form__footer {
    gap: 14px;
  }

  .cookie-consent__actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tak-form input,
  .tak-form select,
  .tak-form textarea,
  .tak-form .tak-form__submit,
  .popup .close {
    scroll-behavior: auto;
    transition: none;
  }
}

/* Form layout also responds to its own width, not only to the viewport. */
@container tak-form (max-width: 820px) {
  .tak-form__grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container tak-form (max-width: 760px) {
  .tak-form__footer {
    grid-template-columns: minmax(0, 1fr);
  }

  .tak-form__consent {
    grid-column: auto;
  }

  .tak-form__actions {
    grid-column: auto;
  }
}

@container tak-form (max-width: 620px) {
  .tak-form__grid--2,
  .tak-form__grid--3 {
    grid-template-columns: minmax(0, 1fr);
  }
}
