/* ============================================================
   Demo-request modal (opened by every [data-demo-open] CTA)
   ============================================================ */

.dmodal {
    position: fixed;
    inset: 0;
    z-index: 210;
    display: grid;
    place-items: center;
    padding: 1.2rem;
}
.dmodal[hidden] { display: none; }

.dmodal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 12, 24, 0.55);
    -webkit-backdrop-filter: blur(6px);
            backdrop-filter: blur(6px);
}

.dmodal__panel {
    position: relative;
    width: min(520px, 100%);
    max-height: min(88vh, 720px);
    overflow-y: auto;
    overflow-x: hidden;          /* vertical scrolling only */
    padding: 2.3rem 2.2rem 2.1rem;
    border-radius: var(--r-panel);
    background: #ffffff;
    box-shadow: 0 40px 90px rgba(8, 12, 24, 0.4);
    animation: dmodal-in 0.45s var(--ease-reveal);
}
@keyframes dmodal-in {
    from { opacity: 0; transform: translateY(26px) scale(0.97); }
    to   { opacity: 1; transform: none; }
}

.dmodal__close {
    position: absolute;
    top: 1.1rem;
    inset-inline-end: 1.1rem;
    display: grid;
    place-items: center;
    width: 40px; height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(11, 18, 32, 0.06);
    color: var(--ink);
    cursor: pointer;
    transition: background 0.3s ease;
}
.dmodal__close:hover { background: rgba(11, 18, 32, 0.12); }
.dmodal__close svg { width: 18px; height: 18px; }

.dmodal__title {
    margin: 0 0 0.35rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--ink);
}
.dmodal__sub {
    margin: 0 0 1.5rem;
    color: var(--muted-2);
    font-size: 0.95rem;
    line-height: 1.6;
}

.dmodal__form { display: flex; flex-direction: column; gap: 1rem; }

/* honeypot — visually removed but present in the submitted payload.
   Clip-hidden with zero footprint: an offset like left:-9999px creates
   sideways scrollable overflow in RTL scroll containers. */
.dmodal__hp {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.dmodal__submit[disabled] { opacity: 0.6; cursor: wait; }
.dmodal__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.dmodal__row--3 { grid-template-columns: 1fr 1fr 1fr; }
.dmodal__row--3 .dmodal__field label {
    font-size: 0.8rem;
    line-height: 1.35;
    min-height: 2.2em;          /* keeps the three inputs on one baseline */
}
@media (max-width: 480px) {
    .dmodal__row, .dmodal__row--3 { grid-template-columns: 1fr; }
    .dmodal__row--3 .dmodal__field label { min-height: 0; }
}

.dmodal__field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.dmodal__field input,
.dmodal__field textarea { width: 100%; min-width: 0; }
.dmodal__field label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink);
}
.dmodal__field input,
.dmodal__field textarea {
    padding: 0.78rem 1rem;
    border: 1.5px solid var(--border-soft);
    border-radius: 0.8rem;
    background: #fbfcfe;
    font-family: inherit;
    font-size: 0.97rem;
    color: var(--ink);
    transition: border-color 0.3s ease, background 0.3s ease;
    resize: vertical;
}
.dmodal__field input:focus,
.dmodal__field textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(31, 122, 224, 0.14);
}
.dmodal__field input.is-invalid,
.dmodal__field textarea.is-invalid { border-color: #d64550; }

.dmodal__consent {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}
.dmodal__consent input {
    margin-top: 0.28rem;
    width: 17px; height: 17px;
    accent-color: var(--accent);
    flex-shrink: 0;
}
.dmodal__consent label {
    font-size: 0.88rem;
    color: var(--muted-2);
    line-height: 1.55;
}

.dmodal__error {
    margin: 0;
    color: #c23440;
    font-size: 0.88rem;
    font-weight: 600;
}

.dmodal__submit { width: 100%; margin-top: 0.3rem; }

/* success view */
.dmodal__success {
    text-align: center;
    padding: 1.5rem 0 0.5rem;
}
.dmodal__success[hidden] { display: none; }
.dmodal__success-icon {
    display: grid;
    place-items: center;
    width: 74px; height: 74px;
    margin: 0 auto 1.2rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-soft));
    color: #ffffff;
    box-shadow: 0 16px 36px rgba(31, 122, 224, 0.35);
}
.dmodal__success-icon svg { width: 36px; height: 36px; }
.dmodal__success h3 {
    margin: 0 0 0.4rem;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--ink);
}
.dmodal__success p {
    margin: 0;
    color: var(--muted-2);
    font-size: 0.98rem;
}

@media (prefers-reduced-motion: reduce) {
    .dmodal__panel { animation: none; }
}
