/* Form shells and layout (wedjat-cursor). BEM block: .wd-form */

.wd-form {
  --form-radius: 22px;
  --form-pad: clamp(24px, 4vw, 36px);
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: none;
  margin: 0 auto var(--wd-space-5);
  padding: var(--form-pad);
  overflow: hidden;
  border: 0;
  border-radius: var(--form-radius);
  background:
    linear-gradient(168deg, var(--form-shell-top) 0%, var(--form-shell-mid) 40%, var(--form-shell-deep) 100%);
  box-shadow:
    inset 0 1px 0 var(--form-rim-light),
    inset 0 -1px 0 var(--form-rim-deep),
    0 2px 4px rgba(15, 111, 115, .06),
    0 14px 34px -12px rgba(15, 111, 115, .2),
    0 6px 18px -8px rgba(47, 104, 183, .12);
  color: var(--form-text);
}

/* .wd-form::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--wd-teal-deep) 0%, var(--wd-teal) 38%, var(--wd-lapis) 72%, var(--wd-lapis-light) 100%);
  box-shadow: 0 2px 12px rgba(43, 179, 177, .32);
  pointer-events: none;
} */

.wd-form::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  border-radius: inherit;
  background: url("../images/backgrounds/form-paper-antique.jpg") center / cover no-repeat;
  opacity: .26;
  mix-blend-mode: normal;
  pointer-events: none;
}

.wd-form > * {
  position: relative;
  z-index: 1;
}

.wd-form--narrow {
  width: clamp(320px, 80%, 1280px);
  /* max-width: 680px; */
}

.wd-form--compact {
  margin: 0;
  padding: var(--wd-space-4);
  border: 0;
  border-radius: 16px;
  background: linear-gradient(168deg, var(--form-shell-top) 0%, var(--form-shell-mid) 44%, var(--form-shell-deep) 100%);
  box-shadow: inset 0 1px 0 var(--form-rim-light), 0 10px 24px rgba(29, 43, 42, .08);
  backdrop-filter: none;
  display: grid;
  gap: var(--wd-space-3);
}

.wd-form--compact::before {
  content: none;
}

.wd-form--compact::after {
  border-radius: inherit;
  background-size: cover;
  opacity: .26;
}

.wd-form--embedded {
  width: 100%;
  margin: 0;
  padding: var(--wd-space-4);
  border-radius: 16px;
}

.wd-form--inline {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
}

.wd-form--inline::before {
  content: none;
}

.wd-form--inline::after {
  border-radius: inherit;
  opacity: .18;
}

.login-box .wd-form--compact .wd-btn--form,
.wd-widget--account .wd-form--compact .wd-btn--form {
  width: 100%;
}

.wd-form--comment {
  margin: 0 0 var(--wd-space-5);
  padding: var(--wd-space-5);
  border-radius: var(--form-radius);
}

.wd-form--comment .wd-form__title {
  display: flex;
  align-items: center;
  gap: var(--wd-space-2);
  margin: 0 0 var(--wd-space-4);
  color: var(--form-heading);
  font-weight: 600;
  font-size: var(--wd-text-lg);
  line-height: var(--wd-leading-tight);
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}

.wd-form--comment .wd-form__title .fa {
  font-size: .72em;
  opacity: .55;
  transition: transform .2s ease;
}

.wd-form--comment.is-active .wd-form__title .fa {
  transform: rotate(180deg);
}

.wd-form--comment .wd-form__inputs,
.wd-form--comment .wd-form__editor {
  margin-bottom: var(--wd-space-3);
}

.wd-form--comment .wd-form__comment-length {
  margin: -6px 0 var(--wd-space-3);
  color: var(--form-muted);
  font-size: var(--wd-text-sm);
  line-height: 1.45;
}

.wd-form--comment .wd-form__comment-length[data-state="error"] {
  color: #b33d3d;
  font-weight: 700;
}

.wd-form--comment .wd-form__comment-length[data-state="valid"] {
  color: var(--wd-teal-deep);
  font-weight: 600;
}

.wd-form--comment .wd-form__protect {
  display: none;
  margin-bottom: var(--wd-space-3);
}

.wd-form--comment .wd-form__protect-hint {
  margin: 0 0 var(--wd-space-3);
  padding: var(--wd-space-3) var(--wd-space-4);
  border: 1px solid rgba(43, 179, 177, .16);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .78) 0%, rgba(228, 247, 245, .62) 100%);
  box-shadow: var(--form-well-inset);
  color: var(--form-muted);
  font-size: var(--wd-text-sm);
  line-height: 1.5;
}

.wd-form--comment.is-active .wd-form__protect-hint {
  display: none;
}

.wd-form--comment.is-active .wd-form__protect {
  display: block;
}

.wd-form--comment .wd-form__inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--wd-space-3);
}

.wd-form--comment .wd-form__inputs .wd-input {
  min-width: 0;
}

.wd-form--comment .wd-form__actions {
  display: flex;
  justify-content: flex-end;
  margin: var(--wd-space-5) 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.wd-form--comment .wd-form__soc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--wd-space-2);
  margin: 0 0 var(--wd-space-3);
  padding-bottom: var(--wd-space-3);
  border-bottom: 1px solid var(--form-line);
}

.wd-form--comment .wd-form__soc::before {
  content: attr(data-label);
  margin-right: var(--wd-space-1);
  color: var(--form-muted);
  font-size: var(--wd-text-sm);
  font-weight: 500;
}

.wd-form--comment .wd-form__soc a {
  display: block;
  transition: transform .18s ease;
}

.wd-form--comment .wd-form__soc a:hover {
  transform: translateY(-1px);
}

.wd-form--comment .wd-form__soc img {
  display: block;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(29, 43, 42, .08);
  border-radius: 50%;
}

.wd-form__title,
.wd-form .wd-heading {
  margin: 0 0 var(--wd-space-5);
  color: var(--form-heading);
  font-weight: 700;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  line-height: var(--wd-leading-tight);
  letter-spacing: -.02em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .72);
}

.wd-form__lead,
.wd-form .full-text,
.wd-form > .berrors,
.wd-form > div:not([class]) {
  margin: 0 0 var(--wd-space-5);
  padding: var(--wd-space-4);
  border: 1px solid rgba(43, 179, 177, .18);
  border-left: 3px solid var(--wd-teal);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .84) 0%, rgba(228, 247, 245, .72) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .88),
    inset 0 -1px 0 rgba(47, 104, 183, .08),
    0 3px 10px -4px rgba(15, 111, 115, .12);
  color: var(--form-muted);
  font-size: var(--wd-text-sm);
  line-height: 1.55;
}

.wd-form__lead a,
.wd-form .full-text a,
.wd-form > .berrors a {
  color: var(--wd-teal-deep);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: .14em;
}

/* DLE keeps the related-news response container empty until a search runs. */
.wd-form #related_news:empty {
  display: none;
}

.wd-form .form-vote.is-hidden {
  display: none;
}

.wd-form #related_news:not(:empty) {
  border-color: rgba(140, 95, 40, .16);
  border-left-color: rgba(196, 160, 81, .56);
  background: rgba(255, 253, 247, .76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}

:root[data-wd-theme="dark"] .wd-form #related_news:not(:empty) {
  border-color: rgba(228, 191, 99, .16);
  border-left-color: rgba(228, 191, 99, .34);
  background: rgba(255, 249, 238, .055);
  box-shadow: inset 0 1px 0 rgba(255, 249, 238, .07);
}

.wd-form__row,
.wd-form__row--editor,
.wd-form__captcha-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--wd-space-2);
  margin-bottom: var(--wd-space-5);
}

.wd-form__label {
  color: var(--form-heading);
  font-size: var(--wd-text-sm);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .58);
}

.wd-form__field {
  display: grid;
  gap: var(--wd-space-2);
  margin: 0;
}

.wd-form__row--editor {
  align-items: stretch;
}

.wd-form__row--editor:has(.bb-editor, .fr-box, .tox-tinymce) > .wd-form__label {
  margin-bottom: var(--wd-space-1);
}

.wd-form .bb-editor,
.wd-form .fr-box,
.wd-form .tox-tinymce {
  width: 100%;
  max-width: 100%;
}

.wd-form__row--required .wd-form__label::after {
  content: " *";
  width: auto;
  height: auto;
  margin-left: 2px;
  border-radius: 0;
  background: none;
  color: var(--form-primary);
  font-weight: 700;
  vertical-align: baseline;
}

.wd-form__row > input[type="button"].wd-btn,
.wd-form__row > .wd-btn[type="button"] {
  justify-self: start;
}

.wd-form__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--wd-space-3);
  margin: var(--wd-space-6) 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.wd-form--compact .wd-form__actions {
  margin: var(--wd-space-3) 0 0;
  padding: var(--wd-space-3) 0 0;
  border-radius: 0;
  background: none;
}

.wd-form__actions .wd-btn,
.wd-form__button {
  min-width: 160px;
}

.wd-form__question,
#result-registration {
  padding: var(--wd-space-3) var(--wd-space-4);
  border: 1px solid rgba(43, 179, 177, .16);
  border-radius: 12px;
  background: var(--form-well-bg);
  box-shadow: var(--form-well-inset);
  color: var(--form-text);
  font-size: var(--wd-text-sm);
  line-height: 1.45;
}

.wd-form__protect {
  padding: var(--wd-space-4);
  border: 1px solid rgba(43, 179, 177, .18);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(236, 250, 249, .82) 0%, rgba(220, 240, 248, .68) 100%);
  box-shadow:
    inset 0 2px 6px rgba(15, 111, 115, .07),
    inset 0 1px 0 rgba(255, 255, 255, .65);
}

.wd-form__protect .wd-form__row:last-child {
  margin-bottom: 0;
}

.wd-form .wd-form__field img,
.wd-form .wd-form__field .captcha {
  margin-top: var(--wd-space-2);
  border-radius: 10px;
}

/* PM page */
.wd-pm {
  display: grid;
  gap: var(--wd-space-5);
  width: 100%;
  max-width: none;
  margin: 0 auto var(--wd-space-5);
}

.wd-pm__header,
.wd-pm .wd-form__header {
  padding-bottom: var(--wd-space-3);
  border-bottom: 1px solid var(--wd-line);
}

.wd-pm__title,
.wd-pm .wd-form__title {
  margin: 0;
  color: var(--form-heading);
  font-weight: 700;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  line-height: var(--wd-leading-tight);
}

.wd-pm__status {
  padding: var(--wd-space-4);
  border: 1px solid rgba(43, 179, 177, .18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .82) 0%, rgba(228, 247, 245, .68) 100%);
  box-shadow: var(--form-well-inset);
  color: var(--form-text);
}

.wd-form__checks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--wd-space-2) var(--wd-space-3);
  margin-bottom: var(--wd-space-5);
}

.wd-form__checks .wd-form__label {
  font-size: var(--wd-text-sm);
  font-weight: 500;
  line-height: 1.4;
}

.wd-form-consent {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin: 0 0 var(--wd-space-5);
  padding: 14px 16px;
  border: 1px solid rgba(43, 179, 177, .24);
  border-radius: 14px;
  background: rgba(43, 179, 177, .07);
  color: var(--form-text);
  font-size: var(--wd-text-sm);
  line-height: 1.45;
  cursor: pointer;
}

.wd-form-consent__control {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: #247f7d;
}

.wd-form-consent__control:focus-visible {
  outline: 3px solid rgba(43, 179, 177, .34);
  outline-offset: 3px;
}

.wd-form-consent__text {
  min-width: 0;
}

.wd-form-consent__text::after {
  content: " *";
  color: #b33d3d;
  font-weight: 800;
}

.wd-form--compact .wd-form-consent {
  margin-top: 12px;
  padding: 11px 12px;
  font-size: .78rem;
}

/* Personal / service pages — plain white substrate */
.wd-page-panel {
  --panel-radius: 22px;
  display: grid;
  gap: var(--wd-space-5);
  width: 100%;
}

.wd-page-panel:not(:has(.wd-content--search, .wd-static, .iching-page)) {
  padding: clamp(20px, 3.2vw, 32px);
  border: 0;
  border-radius: var(--panel-radius);
  background: var(--panel-bg);
  box-shadow: var(--panel-shadow);
}

.wd-page-panel .wd-content {
  min-width: 0;
}

.wd-page-panel:not(:has(.wd-content--search, .wd-static, .iching-page)) .wd-pm {
  margin: 0;
  gap: var(--wd-space-5);
}

.wd-page-panel:not(:has(.wd-content--search, .wd-static, .iching-page)) .wd-pm__header {
  padding-bottom: var(--wd-space-3);
  border-bottom: 1px solid var(--panel-line);
}

.wd-page-panel:not(:has(.wd-content--search, .wd-static, .iching-page)) .wd-content > .wd-form,
.wd-page-panel:not(:has(.wd-content--search, .wd-static, .iching-page)) .wd-pm .wd-form {
  margin-bottom: 0;
}

.wd-page-panel:has(.wd-content--search, .wd-static, .iching-page) {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.wd-page-panel:not(:has(.wd-content--search, .wd-static, .iching-page)) .table-resp {
  padding: var(--wd-space-3);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, .96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .92);
}

.wd-page-panel:not(:has(.wd-content--search, .wd-static, .iching-page)) .us-prof {
  padding: var(--wd-space-2);
}

@media (max-width: 720px) {
  .wd-form:not(.wd-form--compact) {
    width: 100%;
    max-width: none;
    --form-pad: var(--wd-space-5);
    padding: var(--form-pad);
    border-radius: 18px;
  }

  .wd-form__actions {
    margin-inline: 0;
    padding-inline: 0;
    padding-bottom: 0;
  }

  .wd-form--comment .wd-form__inputs {
    grid-template-columns: 1fr;
  }

  .wd-form__actions {
    justify-content: stretch;
  }

  .wd-form__actions .wd-btn,
  .wd-form__actions button {
    width: 100% !important;
    min-width: 0;
  }
}
