/* FACTEO Premium Legal Documents Styling */

.legal-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.legal-header-banner {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #1e3a8a 100%);
    color: #ffffff;
    padding: 1.25rem 1.5rem;
    border-radius: 14px 14px 0 0;
}

.legal-content {
    font-size: 0.92rem;
    line-height: 1.7;
    color: #334155;
}

.legal-content h2,
.legal-content .legal-doc-title {
    color: #0f172a;
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legal-content h3,
.legal-content .legal-article-title {
    color: #1e3a8a;
    font-size: 0.98rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid #f1f5f9;
}

.legal-content h3::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 16px;
    background: var(--primary-color, #2563eb);
    border-radius: 3px;
}

.legal-content p {
    margin-bottom: 0.85rem;
    text-align: justify;
}

.legal-content ul,
.legal-content ol {
    margin-bottom: 1rem;
    padding-left: 1.4rem;
}

.legal-content li {
    margin-bottom: 0.4rem;
}

.legal-section-block {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    transition: var(--transition, all 0.2s ease);
}

.legal-section-block:hover {
    border-color: #cbd5e1;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}

.legal-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #dbeafe;
}

.legal-callout-info {
    background: #eff6ff;
    border-left: 4px solid #2563eb;
    border-radius: 0 10px 10px 0;
    padding: 0.85rem 1rem;
    margin: 1rem 0;
    font-size: 0.88rem;
    color: #1e40af;
}

.legal-signatures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1.5px dashed #cbd5e1;
}

.signature-box {
    background: #f8fafc;
    border: 1.5px dashed #94a3b8;
    border-radius: 12px;
    padding: 1.25rem;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.signature-box-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569;
    margin-bottom: 0.5rem;
}

.signature-box-placeholder {
    color: #94a3b8;
    font-style: italic;
    font-size: 0.8rem;
}

/* Mobile Fullscreen & Scrollable Modal Fix */
@media (max-width: 767.98px) {
    .modal-dialog.modal-fullscreen-md-down,
    .modal .modal-dialog,
    .modal.fade .modal-dialog,
    .modal.show .modal-dialog {
        margin: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        display: flex !important;
        flex-direction: column !important;
        transform: none !important;
    }

    .modal-dialog.modal-fullscreen-md-down .modal-content,
    .modal .modal-dialog .modal-content,
    .modal.fade .modal-dialog .modal-content,
    .modal.show .modal-dialog .modal-content {
        border-radius: 0 !important;
        border: none !important;
        height: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    .modal-dialog.modal-fullscreen-md-down .modal-header,
    .modal .modal-dialog .modal-header,
    .modal.fade .modal-dialog .modal-header,
    .modal.show .modal-dialog .modal-header {
        flex: 0 0 auto !important;
        padding: 0.85rem 1rem !important;
        border-radius: 0 !important;
        z-index: 20 !important;
    }

    .modal-dialog.modal-fullscreen-md-down .modal-body,
    .modal .modal-dialog .modal-body,
    .modal.fade .modal-dialog .modal-body,
    .modal.show .modal-dialog .modal-body {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        max-height: calc(100dvh - 120px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 0.75rem 0.85rem !important;
        background: #ffffff !important;
    }

    .modal-dialog.modal-fullscreen-md-down .legal-doc-title,
    .modal .modal-dialog .legal-doc-title {
        font-size: 1.05rem !important;
        margin-bottom: 0.75rem !important;
    }

    .modal-dialog.modal-fullscreen-md-down .legal-section-block,
    .modal .modal-dialog .legal-section-block {
        padding: 0.75rem 0.85rem !important;
        margin-bottom: 0.75rem !important;
    }

    .modal-dialog.modal-fullscreen-md-down .modal-footer,
    .modal .modal-dialog .modal-footer,
    .modal.fade .modal-dialog .modal-footer,
    .modal.show .modal-dialog .modal-footer {
        flex: 0 0 auto !important;
        padding: 0.65rem 1rem calc(0.65rem + env(safe-area-inset-bottom, 0px)) 1rem !important;
        background: #ffffff !important;
        border-top: 1px solid #e2e8f0 !important;
        z-index: 20 !important;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08) !important;
    }

    .modal-dialog.modal-fullscreen-md-down .modal-footer button,
    .modal .modal-dialog .modal-footer button,
    .modal.fade .modal-dialog .modal-footer button,
    .modal.show .modal-dialog .modal-footer button {
        width: 100% !important;
    }
}
