/**
 * FLOWNIQ Demo-Flow CTA Modal & Form Styles (alternativer CTA)
 *
 * Self-contained stylesheet for the Demo-Flow modal (PDF-Upload + Prozessbeschreibung).
 * Vollständig unabhängig vom Standard-CTA. Auf einer Seite wird genau eines der
 * beiden CSS-Files eingebunden:
 *   Standard:   <link rel="stylesheet" href="/css/flowniq-cta.css">
 *   Demo-Flow:  <link rel="stylesheet" href="/css/flowniq-demo-cta.css">
 *
 * Die Basis-Modal-Regeln sind bewusst identisch zu flowniq-cta.css gehalten,
 * damit beide CTAs gleich aussehen. Demo-spezifische Elemente (Dropzone,
 * Textarea, "und/oder"-Trenner) sind klar markiert.
 */

/* ===========================================================================
   Basis: Modal (identisch zum Standard-CTA)
   =========================================================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    color: #333;
    border-radius: 16px;
    width: 90%;
    max-width: 520px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 28px;
    border-bottom: 1px solid #eef1f6;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #1a1c3d;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 26px 28px 28px;
}

/* Form-Grundlagen */
.form-group {
    margin-bottom: 22px;
}

/* Consent-Gate als erkennbarer erster Schritt (schaltet die Felder frei) */
#demoLeadForm .form-group:first-child {
    background: #f5f8fc;
    border: 1px solid #e4e9f1;
    border-radius: 10px;
    padding: 14px 16px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 14.5px;
    line-height: 1.55;
    color: #3a3d5c;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: rgba(72, 182, 250, 1);
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 2px;
    flex-shrink: 0;
}

.info-tooltip-trigger {
    background: none;
    border: none;
    color: rgba(72, 182, 250, 1);
    cursor: help;
    padding: 0;
    font-size: inherit;
    text-decoration: underline;
}

.info-tooltip-trigger:hover {
    color: rgba(52, 162, 230, 1);
}

.tooltip {
    background: #333;
    color: white;
    padding: 10px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.4;
    display: none;
    position: absolute !important;
    left: 0 !important;
    top: calc(100% + 5px) !important;
    width: 100% !important;
    box-sizing: border-box;
    z-index: 100;
}

.tooltip.visible {
    display: block;
}

.form-group:has(.tooltip) {
    position: relative;
}

.tooltip a {
    color: rgba(72, 182, 250, 1);
    text-decoration: underline;
}

.tooltip a:hover {
    color: rgba(112, 202, 255, 1);
}

/* Input-Felder */
.demo-modal input[type="email"],
.demo-modal input[type="text"],
.demo-modal textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.demo-modal input[type="email"]:focus,
.demo-modal input[type="text"]:focus,
.demo-modal textarea:focus {
    outline: none;
    border-color: rgba(72, 182, 250, 1);
    box-shadow: 0 0 0 3px rgba(72, 182, 250, 0.1);
}

.demo-modal input[type="email"]:disabled,
.demo-modal input[type="text"]:disabled,
.demo-modal textarea:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    color: #999;
}

.demo-modal input[type="email"][aria-invalid="true"] {
    border-color: #d9534f;
}

/* Fehlermeldung */
.error-message {
    color: #d9534f;
    font-size: 14px;
    margin-top: 5px;
}

/* Submit Button */
#demoSubmitBtn {
    background: #2b2d42;
    color: white;
    padding: 0.875rem 2rem;
    border-radius: 0.5rem;
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s, opacity 0.2s;
}

#demoSubmitBtn:hover:not(:disabled) {
    background: #1f2130;
}

#demoSubmitBtn:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

/* Hinweis unter dem (zunächst deaktivierten) Submit-Button */
.demo-submit-hint {
    margin: 10px 0 0;
    font-size: 13px;
    line-height: 1.45;
    color: #8890a4;
    text-align: center;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    margin-top: 20px;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid rgba(72, 182, 250, 1);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success View */
.success-message {
    text-align: center;
    padding: 20px;
}

.success-message svg {
    margin-bottom: 20px;
}

.success-message h2 {
    color: rgba(72, 182, 250, 1);
    margin-bottom: 10px;
    font-size: 24px;
}

.success-message p {
    color: #666;
    font-size: 16px;
    line-height: 1.5;
}

/* Accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ===========================================================================
   Demo-Flow spezifisch
   =========================================================================== */

/* Intro-/Animations-Copy */
.demo-intro {
    margin: 0 0 20px;
    font-size: 15px;
    line-height: 1.55;
    color: #555;
}

/* Upload-Dropzone */
.demo-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
    padding: 22px 16px;
    border: 1.5px dashed #cfd4dc;
    border-radius: 8px;
    background: #fafbfc;
    color: #2b2d42;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

.demo-dropzone:hover,
.demo-dropzone:focus,
.demo-dropzone.dragover {
    border-color: rgba(72, 182, 250, 1);
    background: rgba(72, 182, 250, 0.06);
    color: #1f2130;
    outline: none;
}

/* Deaktivierter Zustand (vor Consent) */
.demo-dropzone.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.demo-dropzone-icon {
    color: rgba(72, 182, 250, 1);
}

.demo-dropzone-text {
    font-size: 15px;
    font-weight: 600;
}

.demo-dropzone-hint {
    font-size: 12px;
    color: #9ca3af;
}

/* Ausgewählte Datei */
.demo-file-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    background: rgba(72, 182, 250, 0.08);
    border: 1px solid rgba(72, 182, 250, 0.25);
}

.demo-file-name {
    font-size: 14px;
    color: #2b2d42;
    word-break: break-all;
    line-height: 1.3;
}

.demo-file-remove {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
}

.demo-file-remove:hover {
    color: #d9534f;
}

/* "und / oder" Trenner */
.demo-or {
    display: flex;
    align-items: center;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
    margin: 4px 0 20px;
}

.demo-or::before,
.demo-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #eee;
}

.demo-or span {
    padding: 0 12px;
}

/* Textarea */
.demo-textarea {
    resize: vertical;
    min-height: 92px;
    line-height: 1.5;
}

/* ===========================================================================
   Responsive
   =========================================================================== */

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header {
        padding: 15px;
    }

    .modal-body {
        padding: 15px;
    }

    .checkbox-label {
        font-size: 13px;
    }

    .demo-intro {
        font-size: 14px;
    }

    .demo-dropzone {
        padding: 18px 12px;
    }
}
