/* =========================================================
   BuildByMi – Formular im Fenster (gemeinsam für Events und Downloads)
   Kennzeichen oben (Eyebrow), Dialog, Felder, Fehler- und Erfolgsmeldung.
   Wird vor der Seiten-CSS geladen, damit Seiten Details anpassen können.
   ========================================================= */

/* ---------- Kennzeichen (Eyebrow) ---------- */
.ev-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 22px;
  padding: 7px 15px 7px 12px;
  border-radius: 999px;
  background: var(--brand-tint);
  border: 1px solid rgba(85, 48, 245, .16);
  font-size: .84rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--brand-strong);
}
.ev-eyebrow__dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 0 4px rgba(85, 48, 245, .14);
}

/* ---------- Anmeldefenster ---------- */
body:has(.ev-dialog[open]) { overflow: hidden; }
.ev-dialog [hidden] { display: none !important; }   /* das Fenster liegt außerhalb von .events-page */

.ev-dialog {
  width: min(560px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 32px;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}
.ev-dialog::backdrop {
  background: rgba(13, 11, 30, .55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.ev-dialog__card {
  position: relative;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(24px, 4vw, 40px);
  border-radius: 32px;
  background: var(--surface);
  box-shadow: 0 60px 120px -40px rgba(20, 6, 90, .6);
}
.ev-dialog[open] .ev-dialog__card { animation: ev-dialog-in .35s var(--ease-out); }
@keyframes ev-dialog-in {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.ev-dialog__close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.ev-dialog__close:hover { border-color: var(--brand); background: var(--brand-tint); }
.ev-dialog__close svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }

.ev-dialog__head { padding-right: 48px; }
.ev-dialog__head .ev-eyebrow { margin-bottom: 0; }
.ev-dialog__head h2 {
  margin: 16px 0 8px;
  font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.3rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.04em;
}
.ev-dialog__head p { margin: 0 0 22px; line-height: 1.6; color: var(--ink-2); }

/* ---------- Formular (wie das Workshop-Formular) ---------- */
.ev-form { display: grid; gap: 16px; }
.ev-field { display: grid; gap: 7px; }
.ev-field__label { font-size: .85rem; font-weight: 700; color: var(--ink); }
.ev-field__label em { font-style: normal; font-weight: 500; color: var(--ink-2); }
.ev-field input {
  width: 100%;
  min-height: 50px;
  padding: 13px 15px;
  border-radius: 14px;
  border: 1.5px solid rgba(13, 11, 30, .12);
  background: var(--bg);
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.ev-field input:focus {
  outline: none;
  border-color: var(--brand);
  background-color: #fff;
  box-shadow: 0 0 0 4px rgba(85, 48, 245, .14);
}

.ev-consent {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  font-size: .88rem;
  line-height: 1.55;
  color: var(--ink-2);
  cursor: pointer;
}
.ev-consent input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); cursor: pointer; }
.ev-consent a { color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.ev-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.ev-field.is-invalid input { border-color: #E5484D; background: #FFF6F6; }
.ev-consent.is-invalid { color: #C4302B; }
.ev-form__error {
  margin: 0;
  padding: 12px 16px;
  border-radius: 14px;
  background: #FFF0F0;
  color: #B42318;
  font-size: .9rem;
  font-weight: 600;
}
.ev-form__error a { text-decoration: underline; text-underline-offset: 3px; }
.ev-form__submit { justify-self: start; }
.ev-form__submit.is-loading { opacity: .7; pointer-events: none; }

.ev-form__success { display: grid; justify-items: start; gap: 12px; padding: 8px 0 4px; outline: none; }
.ev-form__success-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 14px 28px -12px rgba(85, 48, 245, .8);
}
.ev-form__success-icon svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.ev-form__success h3 { margin: 6px 0 0; font-size: 1.6rem; font-weight: 700; letter-spacing: -.03em; }
.ev-form__success p { margin: 0 0 8px; max-width: 30rem; line-height: 1.6; color: var(--ink-2); }

@media (max-width: 620px) {
  .ev-form__submit,
  .ev-form__success .btn { width: 100%; justify-content: space-between; }
  .ev-form__success .btn--ghost { justify-content: center; }
}
