/* Web Studio 19 — RadicalForm forms system v3
   Единая система форм: кнопки, модалки, поля, состояния и адаптив.
   Поддержка старых классов сохранена: .web-project-*, .web-header-request__button, .web-hero-request__button.
*/

:root {
  --wf-accent: #3366ff;
  --wf-accent-hover: #2458e6;
  --wf-accent-dark: #1f4ed8;

  --wf-bg: #ffffff;
  --wf-bg-soft: #f3f6fb;
  --wf-bg-side: #f3f5f8;

  --wf-title: #111827;
  --wf-text: #172033;
  --wf-muted: #5f6b7a;

  --wf-border: #dbe4f0;
  --wf-border-strong: #d7deea;

  --wf-overlay: rgba(14, 23, 42, 0.58);
  --wf-shadow: 0 28px 80px rgba(15, 23, 42, 0.30);

  --wf-radius: 24px;
  --wf-radius-mobile: 18px;
  --wf-control-radius: 12px;
  --wf-button-radius: 14px;

  --wf-button-height: 48px;
  --wf-button-padding: 13px 24px;
  --wf-button-font: 15px;
}

/* Wrappers */

:is(.web-form-box, .web-header-request, .web-hero-request) {
  display: inline-flex;
  align-items: center;
}

/* Buttons */

:is(.web-form-trigger, .web-header-request__button, .web-hero-request__button, .web-form__submit, .web-project-form__submit) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--wf-button-height);
  padding: var(--wf-button-padding);
  border: 0;
  border-radius: var(--wf-button-radius);
  background: var(--wf-accent);
  color: #ffffff;
  font-size: var(--wf-button-font);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(51, 102, 255, 0.24);
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

:is(.web-form-trigger, .web-header-request__button, .web-hero-request__button, .web-form__submit, .web-project-form__submit):is(:hover, :focus-visible) {
  background: var(--wf-accent-hover);
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 14px 32px rgba(51, 102, 255, 0.32);
  transform: translateY(-1px);
}

:is(.web-form-trigger, .web-header-request__button, .web-hero-request__button, .web-form__submit, .web-project-form__submit):focus-visible {
  outline: 3px solid rgba(51, 102, 255, 0.24);
  outline-offset: 3px;
}

:is(.web-form-trigger, .web-header-request__button, .web-hero-request__button) {
  width: auto;
}

:is(.web-form__submit, .web-project-form__submit) {
  width: 100%;
  margin-top: 2px;
}

/* Modal base */

body.web-project-modal-is-open {
  overflow: hidden;
}

:is(.web-form-modal, .web-project-modal)[hidden] {
  display: none !important;
}

:is(.web-form-modal, .web-project-modal) {
  position: fixed !important;
  inset: 0 !important;
  z-index: 100000 !important;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  background: transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

:is(.web-form-modal, .web-project-modal).is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

:is(.web-form-modal__overlay, .web-project-modal__overlay) {
  position: fixed;
  inset: 0;
  background: var(--wf-overlay);
  cursor: pointer;
}

:is(.web-form-modal__dialog, .web-project-modal__dialog) {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  max-height: calc(100dvh - 48px);
  margin: auto;
  overflow: hidden;
  border-radius: var(--wf-radius);
  background: var(--wf-bg);
  box-shadow: var(--wf-shadow);
}

:is(.web-form-modal__inner, .web-project-modal__inner, .web-form-modal__main, .web-project-modal__main) {
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  scrollbar-gutter: stable;
}

:is(.web-form-modal__inner, .web-project-modal__inner) {
  padding: 32px;
}

:is(.web-form-modal__close, .web-project-modal__close) {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--wf-bg-soft);
  color: var(--wf-text);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

:is(.web-form-modal__close, .web-project-modal__close):is(:hover, :focus-visible) {
  background: #e8eef8;
  color: var(--wf-title);
}

:is(.web-form-modal__close, .web-project-modal__close) svg {
  display: block;
  width: 18px;
  height: 18px;
}

:is(.web-form-modal__title, .web-project-modal__title) {
  margin: 0 48px 10px 0;
  color: var(--wf-title);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.18;
}

:is(.web-form-modal__text, .web-project-modal__text) {
  margin: 0 0 20px;
  color: var(--wf-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* Split modal */

:is(.web-form-modal--split, .web-project-modal--hero) :is(.web-form-modal__dialog, .web-project-modal__dialog) {
  width: min(1040px, calc(100vw - 48px));
  max-height: calc(100dvh - 48px);
}

:is(.web-form-modal--split, .web-project-modal--hero) :is(.web-form-modal__layout, .web-project-modal__layout) {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  max-height: calc(100dvh - 48px);
}

:is(.web-form-modal--split, .web-project-modal--hero) :is(.web-form-modal__side, .web-project-modal__side) {
  min-height: 0;
  padding: 26px 26px;
  overflow-y: auto;
  background: var(--wf-bg-side);
}

:is(.web-form-modal--split, .web-project-modal--hero) :is(.web-form-modal__main, .web-project-modal__main) {
  min-height: 0;
  padding: 26px;
  overflow-y: auto;
}

:is(.web-form-modal--split, .web-project-modal--hero) :is(.web-form-modal__title, .web-project-modal__title) {
  margin-right: 52px;
}

:is(.web-form-modal--split, .web-project-modal--hero) :is(.web-form-modal__text, .web-project-modal__text) {
  max-width: 560px;
  margin-right: 52px;
  margin-bottom: 16px;
}

/* Split side */

:is(.web-form-modal__side-title, .web-project-modal__side-title) {
  margin: 0 0 24px;
  color: #163c9f;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.15;
}

:is(.web-form-modal__side-list, .web-project-modal__side-list) {
  display: grid;
  gap: 14px;
  margin: 0 0 30px;
  padding: 0;
  list-style: none;
}

:is(.web-form-modal__side-list, .web-project-modal__side-list) li {
  position: relative;
  padding-left: 24px;
  color: #1f2937;
  font-size: 16px;
  line-height: 1.35;
}

:is(.web-form-modal__side-list, .web-project-modal__side-list) li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--wf-accent-dark);
  transform: translateY(-50%);
}

:is(.web-form-modal__side-note, .web-project-modal__side-note) {
  margin: 0;
  padding-top: 24px;
  border-top: 1px solid rgba(31, 41, 55, 0.14);
  color: var(--wf-muted);
  font-size: 15px;
  line-height: 1.45;
}

:is(.web-form-modal__mobile-details, .web-project-modal__mobile-details) {
  display: none;
}

/* Form */

:is(.web-form, .web-project-form) {
  display: grid;
  gap: 12px;
}

:is(.web-form__row, .web-project-form__row) {
  display: grid;
  gap: 6px;
}

:is(.web-form__label, .web-project-form__label) {
  color: var(--wf-title);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
}

:is(.web-form__control, .web-project-form__control) {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-control-radius);
  background: var(--wf-bg);
  color: var(--wf-text);
  font-size: 14px;
  line-height: 1.4;
  outline: none;
  box-shadow: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

:is(.web-form__control, .web-project-form__control):focus {
  border-color: var(--wf-accent);
  box-shadow: 0 0 0 4px rgba(51, 102, 255, 0.12);
}

:is(.web-form__control, .web-project-form__control).is-invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.12);
}

textarea:is(.web-form__control, .web-project-form__control),
.web-project-form textarea.web-project-form__control {
  min-height: 82px;
  resize: vertical;
}

:is(.web-form__privacy, .web-project-form__privacy) {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin: 0;
  color: var(--wf-muted);
  font-size: 13px;
  line-height: 1.4;
}

:is(.web-form__privacy, .web-project-form__privacy) input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
}

:is(.web-form__privacy, .web-project-form__privacy) a {
  color: var(--wf-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* RadicalForm messages */

:is(.web-form, .web-project-form) :is(.rf-message, .rf-alert, .rf-success, .rf-error) {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
}

:is(.web-form, .web-project-form) .rf-success {
  background: #ecfdf3;
  color: #166534;
}

:is(.web-form, .web-project-form) :is(.rf-error, .rf-alert) {
  background: #fef2f2;
  color: #991b1b;
}
/* Joomla system success message after form submit */

#system-message-container {
  position: fixed;
  top: 96px;
  left: 50%;
  z-index: 99990;
  width: min(620px, calc(100vw - 32px));
  margin: 0;
  padding: 0;
  pointer-events: none;
  transform: translateX(-50%);
}

#system-message-container:empty {
  display: none;
}

#system-message-container joomla-alert {
  box-sizing: border-box;
}

#system-message-container joomla-alert[type="success"] {
  position: relative;
  display: block;
  min-height: 62px;
  margin: 0;
  padding: 17px 56px 17px 58px;
  overflow: hidden;
  border: 1px solid rgba(51, 102, 255, 0.18);
  border-radius: 18px;
  background: #ffffff;
  color: var(--wf-text, #172033);
  box-shadow: 0 18px 54px rgba(15, 23, 42, 0.14);
  pointer-events: auto;
}

#system-message-container joomla-alert[type="success"]::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 50%;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(51, 102, 255, 0.12);
  transform: translateY(-50%);
}

#system-message-container joomla-alert[type="success"]::after {
  content: "";
  position: absolute;
  left: 29px;
  top: 50%;
  width: 7px;
  height: 4px;
  border-left: 2px solid var(--wf-accent, #3366ff);
  border-bottom: 2px solid var(--wf-accent, #3366ff);
  transform: translateY(-60%) rotate(-45deg);
}

#system-message-container joomla-alert[type="success"] .alert-heading {
  display: none;
}

#system-message-container joomla-alert[type="success"] .alert-wrapper {
  display: block;
  margin: 0;
  padding: 0;
}

#system-message-container joomla-alert[type="success"] .alert-message {
  margin: 0;
  color: var(--wf-text, #172033);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
}

#system-message-container joomla-alert[type="success"] .joomla-alert--close {
  position: absolute;
  top: 50%;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--wf-bg-soft, #f3f6fb);
  color: var(--wf-muted, #5f6b7a);
  font-size: 0;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background-color 0.2s ease, color 0.2s ease;
}

#system-message-container joomla-alert[type="success"] .joomla-alert--close:hover,
#system-message-container joomla-alert[type="success"] .joomla-alert--close:focus-visible {
  background: #e8eef8;
  color: var(--wf-title, #111827);
}

#system-message-container joomla-alert[type="success"] .joomla-alert--close::before,
#system-message-container joomla-alert[type="success"] .joomla-alert--close::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

#system-message-container joomla-alert[type="success"] .joomla-alert--close::before {
  transform: rotate(45deg);
}

#system-message-container joomla-alert[type="success"] .joomla-alert--close::after {
  transform: rotate(-45deg);
}

#system-message-container joomla-alert[type="success"] .joomla-alert--close span {
  display: none;
}

@media (max-width: 767.98px) {
  #system-message-container {
    top: 78px;
    right: 10px;
    left: 10px;
    width: auto;
    transform: none;
  }

  #system-message-container joomla-alert[type="success"] {
    min-height: 58px;
    padding: 15px 50px 15px 50px;
    border-radius: 15px;
  }

  #system-message-container joomla-alert[type="success"]::before {
    left: 16px;
    width: 22px;
    height: 22px;
  }

  #system-message-container joomla-alert[type="success"]::after {
    left: 24px;
  }

  #system-message-container joomla-alert[type="success"] .alert-message {
    font-size: 14px;
    line-height: 1.4;
  }

  #system-message-container joomla-alert[type="success"] .joomla-alert--close {
    right: 8px;
    width: 36px;
    height: 36px;
  }
}
/* Tablet */

@media (max-width: 991.98px) {
  :is(.web-form-modal--split, .web-project-modal--hero) :is(.web-form-modal__dialog, .web-project-modal__dialog) {
    width: min(920px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
  }

  :is(.web-form-modal--split, .web-project-modal--hero) :is(.web-form-modal__layout, .web-project-modal__layout) {
    grid-template-columns: 300px minmax(0, 1fr);
    max-height: calc(100dvh - 32px);
  }

  :is(.web-form-modal--split, .web-project-modal--hero) :is(.web-form-modal__side, .web-project-modal__side) {
    padding: 34px 28px;
  }

  :is(.web-form-modal--split, .web-project-modal--hero) :is(.web-form-modal__main, .web-project-modal__main) {
    padding: 32px 34px 30px;
  }

  :is(.web-form-modal__side-title, .web-project-modal__side-title) {
    font-size: 24px;
  }
}

/* Mobile */

@media (max-width: 767.98px) {
  :is(.web-form-trigger, .web-header-request__button, .web-hero-request__button, .web-form__submit, .web-project-form__submit) {
    min-height: 46px;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
  }

  :is(.web-form-trigger, .web-header-request__button, .web-hero-request__button) {
    width: auto;
  }

  :is(.web-form__submit, .web-project-form__submit) {
    width: 100%;
  }

  :is(.web-form-modal, .web-project-modal) {
    place-items: start center;
    padding: 10px;
  }

  :is(.web-form-modal__dialog, .web-project-modal__dialog) {
    width: min(100%, 520px);
    max-height: calc(100dvh - 20px);
    border-radius: var(--wf-radius-mobile);
  }

  :is(.web-form-modal__inner, .web-project-modal__inner) {
    max-height: calc(100dvh - 20px);
    padding: 24px 16px 18px;
  }

  :is(.web-form-modal__close, .web-project-modal__close) {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
  }

  :is(.web-form-modal__title, .web-project-modal__title) {
    margin-right: 46px;
    font-size: 22px;
    line-height: 1.2;
  }

  :is(.web-form-modal__text, .web-project-modal__text) {
    margin-bottom: 14px;
    font-size: 14px;
    line-height: 1.45;
  }

  :is(.web-form-modal--split, .web-project-modal--hero) :is(.web-form-modal__dialog, .web-project-modal__dialog) {
    width: 100%;
    max-height: calc(100dvh - 20px);
  }

  :is(.web-form-modal--split, .web-project-modal--hero) :is(.web-form-modal__layout, .web-project-modal__layout) {
    display: block;
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
  }

  :is(.web-form-modal--split, .web-project-modal--hero) :is(.web-form-modal__side, .web-project-modal__side) {
    display: none;
  }

  :is(.web-form-modal--split, .web-project-modal--hero) :is(.web-form-modal__main, .web-project-modal__main) {
    max-height: none;
    padding: 22px 14px 16px;
    overflow: visible;
  }

  :is(.web-form-modal--split, .web-project-modal--hero) :is(.web-form-modal__title, .web-project-modal__title) {
    margin-right: 46px;
    font-size: 22px;
  }

  :is(.web-form-modal--split, .web-project-modal--hero) :is(.web-form-modal__text, .web-project-modal__text) {
    margin-right: 0;
  }

  :is(.web-form-modal--split, .web-project-modal--hero) :is(.web-form-modal__mobile-details, .web-project-modal__mobile-details) {
    display: block;
    margin: 0 0 14px;
    border: 1px solid var(--wf-border-strong);
    border-radius: 12px;
    background: #f8fafc;
    overflow: hidden;
  }

  :is(.web-form-modal__mobile-summary, .web-project-modal__mobile-summary) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 11px 14px;
    color: var(--wf-title);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
    list-style: none;
  }

  :is(.web-form-modal__mobile-summary, .web-project-modal__mobile-summary)::-webkit-details-marker {
    display: none;
  }

  :is(.web-form-modal__mobile-summary, .web-project-modal__mobile-summary)::after {
    content: "";
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--wf-accent-dark);
    border-bottom: 2px solid var(--wf-accent-dark);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease;
  }

  :is(.web-form-modal__mobile-details, .web-project-modal__mobile-details)[open] :is(.web-form-modal__mobile-summary, .web-project-modal__mobile-summary)::after {
    transform: rotate(225deg) translateY(-2px);
  }

  :is(.web-form-modal__mobile-content, .web-project-modal__mobile-content) {
    padding: 0 14px 14px;
  }

  :is(.web-form-modal__mobile-list, .web-project-modal__mobile-list) {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  :is(.web-form-modal__mobile-list, .web-project-modal__mobile-list) li {
    color: #4b5563;
    font-size: 13px;
    line-height: 1.4;
  }

  :is(.web-form-modal__mobile-list, .web-project-modal__mobile-list) strong {
    color: var(--wf-title);
    font-weight: 600;
  }

  :is(.web-form, .web-project-form) {
    gap: 11px;
  }

  :is(.web-form__label, .web-project-form__label) {
    font-size: 13px;
  }

  :is(.web-form__control, .web-project-form__control) {
    min-height: 44px;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 14px;
  }

  textarea:is(.web-form__control, .web-project-form__control),
  .web-project-form textarea.web-project-form__control {
    min-height: 78px;
  }

  :is(.web-form__privacy, .web-project-form__privacy) {
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 8px;
    font-size: 11px;
    line-height: 1.35;
  }

  :is(.web-form__privacy, .web-project-form__privacy) input {
    width: 16px;
    height: 16px;
  }

  :is(.web-form-modal--split, .web-project-modal--hero) :is(.web-form__row--site, .web-project-form__row--site) {
    display: none;
  }
}
