/* ==========================================================================
   Demo-Modal – nutzt die Tokens aus styles.css
   ========================================================================== */

html.dm-lock { overflow: hidden; }

.dm {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 24px;
  visibility: hidden;
  transition: visibility 0s linear .5s;
}
.dm[hidden] { display: none; }
.dm.is-open { visibility: visible; transition: visibility 0s; }

.dm__backdrop {
  position: absolute; inset: 0;
  background: rgba(7,7,8,.62);
  -webkit-backdrop-filter: blur(14px) saturate(120%); backdrop-filter: blur(14px) saturate(120%);
  opacity: 0; transition: opacity .5s var(--ease);
}
.dm.is-open .dm__backdrop { opacity: 1; }

.dm__panel {
  position: relative; width: 100%; max-width: 640px; max-height: calc(100dvh - 48px); overflow-y: auto; overscroll-behavior: contain;
  padding: clamp(28px, 4.5vw, 48px);
  border-radius: 28px; outline: 0;
  background: linear-gradient(165deg, rgba(34,34,37,.96) 0%, rgba(17,17,19,.98) 100%);
  border: 1px solid var(--line-strong);
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 60px 140px -30px rgba(0,0,0,.95), 0 0 120px -50px rgba(216,196,143,.35);
  opacity: 0; transform: translate3d(0, 24px, 0) scale(.97);
  transition: opacity .45s var(--ease), transform .6s var(--ease);
  scrollbar-width: thin; scrollbar-color: #3a3a3f transparent;
}
.dm.is-open .dm__panel { opacity: 1; transform: none; transition-delay: .06s; }
.dm__panel::before { content: ''; position: absolute; left: 12%; right: 12%; top: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(216,196,143,.6), transparent); }

.dm__close {
  position: absolute; top: 18px; right: 18px; z-index: 2; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; color: var(--text-dim);
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  transition: color .3s var(--ease), border-color .3s var(--ease), background-color .3s var(--ease), transform .4s var(--ease);
}
.dm__close:hover { color: var(--text); border-color: rgba(216,196,143,.5); background: rgba(216,196,143,.08); transform: rotate(90deg); }

.dm__view[hidden] { display: none; }
.dm__eyebrow { display: flex; align-items: center; gap: 14px; margin: 0 0 22px; font: 500 12px/1 var(--font-mono); letter-spacing: .24em; text-transform: uppercase; color: var(--gold); }
.dm__eyebrow span { width: 32px; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); }
.dm__title { margin: 0; padding-right: 36px; font: 600 clamp(1.55rem, 3.2vw, 2.15rem)/1.12 var(--font-display); letter-spacing: -.03em; color: var(--text); text-wrap: balance; }
.dm__sub { margin: 16px 0 0; max-width: 34em; font-size: 15.5px; line-height: 1.6; color: var(--text-dim); }

/* Formular */
.dm__form { margin-top: 30px; }
.dm__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.dm__field { display: flex; flex-direction: column; min-width: 0; }
.dm__field label { margin-bottom: 8px; font: 500 12.5px/1.2 var(--font-body); color: var(--text-dim); letter-spacing: .01em; }
.dm__field label i { font-style: normal; color: var(--text-faint); margin-left: 6px; }
.dm__field input {
  width: 100%; height: 54px; padding: 0 18px; border-radius: 14px;
  font: 400 16px/1 var(--font-body); color: var(--text);
  background: rgba(255,255,255,.04); border: 1px solid var(--line-strong);
  transition: border-color .3s var(--ease), background-color .3s var(--ease), box-shadow .3s var(--ease);
  -webkit-appearance: none; appearance: none;
}
.dm__field input::placeholder { color: var(--text-faint); }
.dm__field input:hover { border-color: rgba(255,255,255,.22); }
.dm__field input:focus { outline: 0; border-color: rgba(216,196,143,.7); background: rgba(216,196,143,.05); box-shadow: 0 0 0 4px rgba(216,196,143,.12); }
.dm__field input:-webkit-autofill { -webkit-text-fill-color: var(--text); box-shadow: 0 0 0 100px #1d1d20 inset; caret-color: var(--text); }
.dm__field input[aria-invalid="true"] { border-color: rgba(205,150,125,.75); }
.dm__err { min-height: 22px; padding-top: 6px; font-size: 12.5px; line-height: 1.3; color: #d9a995; }

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

.dm__fail { margin: 4px 0 14px; padding: 12px 16px; border-radius: 12px; font-size: 14px; color: #e3b8a5; background: rgba(205,150,125,.1); border: 1px solid rgba(205,150,125,.35); }
.dm__fail[hidden] { display: none; }
.dm__submit { width: 100%; margin-top: 10px; padding: 20px 28px; font-size: 16.5px; position: relative; }
.dm__submit-busy { display: none; }
.dm__submit[aria-busy="true"] { pointer-events: none; opacity: .85; }
.dm__submit[aria-busy="true"] .dm__submit-label { display: none; }
.dm__submit[aria-busy="true"] .dm__submit-busy { display: inline; }
.dm__submit:hover svg { transform: translateX(3px); }
.dm__submit-label { display: inline-flex; align-items: center; gap: 10px; }
.dm__note { margin: 18px 0 0; text-align: center; font: 400 12.5px/1.4 var(--font-mono); letter-spacing: .02em; color: var(--text-faint); }

/* Erfolg */
.dm__view--ok { text-align: left; }
.dm__okmark { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 26px; border-radius: 18px; color: var(--gold); background: rgba(216,196,143,.1); border: 1px solid rgba(216,196,143,.45); box-shadow: 0 0 50px -10px rgba(216,196,143,.5); }
.dm__title--ok { outline: 0; }
.dm__alt { margin-top: 34px; padding-top: 28px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 24px; }
.dm__alt p { margin: 0; max-width: 22em; font-size: 14.5px; line-height: 1.5; color: var(--text-dim); }

.dm__view { animation: dmview .6s var(--ease) both; }
@keyframes dmview { from { opacity: 0; transform: translate3d(0, 10px, 0); } to { opacity: 1; transform: none; } }

/* Mobil: Bottom-Sheet, 16-px-Felder (kein iOS-Zoom), keine Layout-Verschiebung */
@media (max-width: 640px) {
  .dm { align-items: end; padding: 0; }
  .dm__panel { max-width: none; max-height: 94dvh; border-radius: 26px 26px 0 0; padding: 28px 22px calc(24px + env(safe-area-inset-bottom)); transform: translate3d(0, 40px, 0); }
  .dm__grid { grid-template-columns: 1fr; gap: 2px; }
  .dm__title { font-size: 1.55rem; }
  .dm__close { top: 14px; right: 14px; }
  .dm__alt .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .dm, .dm__backdrop, .dm__panel, .dm__close { transition-duration: .01ms !important; transition-delay: 0s !important; }
  .dm__panel, .dm.is-open .dm__panel { transform: none; }
  .dm__view { animation: none; }
  .dm__close:hover { transform: none; }
}

#telefonagent-live { scroll-margin-top: 120px; }
