/* =============================================================================
   CTA Modal – Styles
   Passend zum pp-digital Theme (CSS-Variablen aus main.css)
   ============================================================================= */

/* ── Hintergrund-Overlay ─────────────────────────────────────────────────── */
.cta-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: ctaOverlayIn 0.2s ease both;
}

.cta-modal-overlay[hidden] {
    display: none;
}

/* ── Scrollen des Body verhindern wenn Modal offen ───────────────────────── */
body.cta-modal-open {
    overflow: hidden;
}

/* ── Modal-Container ─────────────────────────────────────────────────────── */
.cta-modal {
    position: relative;
    width: 100%;
    max-width: 540px;
    max-height: 90dvh;
    overflow-y: auto;
    background: var(--surface, #1a1a2e);
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
    animation: ctaModalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ── Schließen-Button ────────────────────────────────────────────────────── */
.cta-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border, rgba(255,255,255,0.12));
    border-radius: 50%;
    color: var(--text-2, #aaa);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.cta-modal-close:hover,
.cta-modal-close:focus-visible {
    background: var(--border, rgba(255,255,255,0.1));
    color: var(--text-1, #fff);
    outline: none;
}

/* ── Modal-Header ────────────────────────────────────────────────────────── */
.cta-modal-header {
    margin-bottom: 1.5rem;
    padding-right: 2.5rem; /* Platz für Schließen-Button */
}

.cta-modal-header .eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent, #5548d9);
    margin-bottom: 0.4rem;
}

.cta-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-1, #fff);
    margin: 0 0 0.5rem;
    line-height: 1.2;
}

.cta-modal-subtitle {
    font-size: 0.9rem;
    color: var(--text-2, #aaa);
    margin: 0;
}

/* ── Status-Meldungen ────────────────────────────────────────────────────── */
.cta-modal-message {
    padding: 0.875rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.cta-modal-message.success {
    background: rgba(22, 163, 74, 0.12);
    border: 1px solid rgba(22, 163, 74, 0.35);
    color: #4ade80;
}

.cta-modal-message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.cta-modal-message[hidden] {
    display: none;
}

/* ── Formular (erbt .contact-form aus main.css) ──────────────────────────── */
.cta-modal .contact-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-2, #ccc);
    margin-bottom: 0.35rem;
    margin-top: 1rem;
}

.cta-modal .contact-form label:first-of-type,
.cta-modal .contact-form label[for="cta-name"] {
    margin-top: 0;
}

.cta-modal .contact-form input,
.cta-modal .contact-form textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: var(--bg, #0c0c24);
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    border-radius: 8px;
    color: var(--text-1, #fff);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.cta-modal .contact-form input:focus,
.cta-modal .contact-form textarea:focus {
    outline: none;
    border-color: var(--accent, #5548d9);
    box-shadow: 0 0 0 3px rgba(85, 72, 217, 0.2);
}

.cta-modal .contact-form textarea {
    resize: vertical;
    min-height: 90px;
}

/* ── Datenschutz-Checkbox ────────────────────────────────────────────────── */
.cta-modal .privacy-checkbox {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    margin-top: 1.25rem;
    font-size: 0.82rem;
    color: var(--text-2, #aaa);
    line-height: 1.5;
    cursor: pointer;
}

.cta-modal .privacy-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    min-width: 20px;
    flex-shrink: 0;
    margin-top: 0.15rem;
    border: 2px solid #00c853;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    position: relative;
    transition: background 0.15s, border-color 0.15s;
}
.cta-modal .privacy-checkbox input[type="checkbox"]:checked {
    background: #00c853;
    border-color: #00c853;
}
.cta-modal .privacy-checkbox input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 7px;
    height: 12px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}
.cta-modal .privacy-checkbox input[type="checkbox"]:focus-visible {
    outline: 2px solid #00c853;
    outline-offset: 2px;
}

.cta-modal .privacy-checkbox a {
    color: var(--accent, #5548d9);
    text-decoration: underline;
}

/* ── Absende-Button ──────────────────────────────────────────────────────── */
.cta-modal .btn.btn-primary {
    width: 100%;
    margin-top: 1.25rem;
    justify-content: center;
    gap: 0.5rem;
}

.cta-modal .btn.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ── DSGVO-Hinweis ───────────────────────────────────────────────────────── */
.cta-modal-dsgvo {
    font-size: 0.75rem;
    color: var(--muted, #666);
    margin-top: 0.875rem;
    line-height: 1.5;
}

/* ── Honeypot (für Nutzer unsichtbar) ────────────────────────────────────── */
.cta-hp {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
    height: 0;
    overflow: hidden;
}

/* ── Animationen ─────────────────────────────────────────────────────────── */
@keyframes ctaOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes ctaModalIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Light-Mode-Anpassungen ──────────────────────────────────────────────── */
[data-theme="light"] .cta-modal {
    background: var(--surface, #ffffff);
    border-color: var(--border, rgba(0,0,0,0.1));
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .cta-modal .contact-form input,
[data-theme="light"] .cta-modal .contact-form textarea {
    background: var(--bg, #f5f5f5);
    border-color: var(--border, rgba(0,0,0,0.15));
    color: var(--text-1, #0c0c24);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .cta-modal {
        padding: 1.5rem 1.25rem;
        max-height: 95dvh;
    }

    .cta-modal-header h2 {
        font-size: 1.25rem;
    }
}
