/* Kontakt-Popup (templates/anfrage.php): FAB + modaler Dialog.
   Baut auf tokens.css und components.css (.btn, .sr-only, :focus-visible) auf. */
/* ── FAB (Floating Action Button) ─────────────────────────────── */
.SPZL-fab {
    position: fixed;
    right: var(--sp-5);
    bottom: var(--sp-5);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: var(--r-pill);
    background: var(--accent);
    color: #0a0a0a;
    font-size: 1.35rem;
    cursor: pointer;
    box-shadow: var(--shadow-1);
    transition: background var(--dur-1) var(--ease-out);
    -webkit-tap-highlight-color: transparent;
}
.SPZL-fab:hover { background: var(--accent-soft); }
.SPZL-fab i { pointer-events: none; }

/* ── Modal: Overlay + Panel ────────────────────────────────────── */
.SPZL-popup {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: var(--sp-4) 0;
    background: rgba(0, 0, 0, .6);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);

    /* Geschlossen: nicht sichtbar und nicht fokussierbar */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--dur-2) var(--ease-out), visibility 0s linear var(--dur-2);
}
.SPZL-popup.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity var(--dur-2) var(--ease-out), visibility 0s;
}

.SPZL-panel {
    position: relative;
    width: calc(100% - var(--sp-5) * 2);
    max-width: 480px;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    padding: var(--sp-6);
    background: var(--bg-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-2);
    transform: translateY(var(--sp-3));
    transition: transform var(--dur-2) var(--ease-out);
}
.SPZL-popup.is-visible .SPZL-panel { transform: translateY(0); }

.SPZL-close {
    position: absolute;
    top: var(--sp-3);
    right: var(--sp-3);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--text-2);
    font-size: 1.1rem;
    cursor: pointer;
    transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.SPZL-close:hover { background: var(--bg-2); color: var(--text-1); }

/* ── Header ────────────────────────────────────────────────────── */
.SPZL-popup-head {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-5);
    padding-right: var(--sp-6);
}
.SPZL-head-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-pill);
    background: var(--bg-2);
    color: var(--text-2);
}
.SPZL-popup-head h3 {
    margin: 0;
    font-size: var(--fs-title3);
    font-weight: 700;
    line-height: var(--lh-snug);
    color: var(--text-1);
}
.SPZL-popup-head p {
    margin: 0;
    font-size: var(--fs-callout);
    color: var(--text-2);
}

/* ── Formular ──────────────────────────────────────────────────── */
.SPZL-field { margin-bottom: var(--sp-4); }
.SPZL-field label {
    display: block;
    margin-bottom: var(--sp-2);
    font-size: var(--fs-callout);
    font-weight: 600;
    color: var(--text-2);
}
.SPZL-field input,
.SPZL-field textarea {
    width: 100%;
    padding: var(--sp-3) var(--sp-4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-sm);
    background: var(--bg-2);
    color: var(--text-1);
    font: inherit;
    font-size: var(--fs-body);
    line-height: var(--lh-normal);
    resize: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color var(--dur-1) var(--ease-out);
}
.SPZL-field input { min-height: 44px; }
.SPZL-field textarea { height: 112px; }
.SPZL-field input::placeholder,
.SPZL-field textarea::placeholder { color: var(--text-3); }
.SPZL-field input:focus,
.SPZL-field textarea:focus { border-color: var(--focus-ring); }

/* Honeypot – komplett versteckt */
.SPZL-honeypot {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    pointer-events: none;
}

/* ── Meldungen ─────────────────────────────────────────────────── */
.SPZL-error:not(:empty) {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-2);
    margin-bottom: var(--sp-4);
    font-size: var(--fs-callout);
    color: var(--err);
}
.SPZL-error i { margin-top: 3px; }

.SPZL-submit { width: 100%; }
.SPZL-submit:disabled { opacity: .55; cursor: not-allowed; }

.SPZL-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: SPZL-spin .7s linear infinite;
}
@keyframes SPZL-spin { to { transform: rotate(360deg); } }
.SPZL-submit.is-loading .SPZL-spinner { display: block; }
.SPZL-submit.is-loading .SPZL-btn-label { display: none; }

.SPZL-success {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-5) 0 var(--sp-2);
    text-align: center;
}
.SPZL-success.is-visible { display: flex; }
.SPZL-success-icon { font-size: 2.5rem; line-height: 1; color: var(--ok); }
.SPZL-success h4 {
    margin: 0;
    font-size: var(--fs-title3);
    font-weight: 700;
    color: var(--text-1);
}
.SPZL-success p {
    margin: 0;
    font-size: var(--fs-callout);
    color: var(--text-2);
}

/* ── Mobil ─────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .SPZL-fab { right: var(--sp-4); bottom: var(--sp-4); }
    .SPZL-panel { padding: var(--sp-5); }
}
