/*
 * Typography of the legal documents (public legal pages, admin preview, payment-step modal).
 * Colours derive from the surrounding text colour so the same rules work on the light public
 * site and in the resident panel's dark theme.
 */
.legal-content {
    --legal-rule: rgba(127, 127, 127, 0.28);
    --legal-fill: rgba(127, 127, 127, 0.08);
    --legal-link: #B4863B;
    line-height: 1.75;
    font-size: 0.975rem;
    overflow-wrap: anywhere;
}

.legal-content > :first-child { margin-top: 0; }

.legal-content h2 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 2.25rem 0 0.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--legal-rule);
}

.legal-content h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem;
}

.legal-content p { margin: 0.75rem 0; }

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

.legal-content ul { list-style: disc; }
.legal-content ol { list-style: decimal; }
.legal-content li { margin: 0.35rem 0; }

.legal-content a {
    color: var(--legal-link);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-content strong { font-weight: 600; }

/* Tables scroll sideways on narrow screens instead of widening the page. */
.legal-content table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.legal-content th,
.legal-content td {
    border: 1px solid var(--legal-rule);
    padding: 0.55rem 0.75rem;
    text-align: left;
    vertical-align: top;
}

.legal-content thead th,
.legal-content tfoot th { background: var(--legal-fill); font-weight: 600; }
.legal-content tbody th { font-weight: 600; width: 34%; }
.legal-content .num { text-align: right; white-space: nowrap; }

/* Company identity block ({{company.identityBlock}}). */
.legal-content dl.legal-identity {
    display: grid;
    grid-template-columns: minmax(8rem, 34%) 1fr;
    margin: 0.75rem 0 1rem;
    border: 1px solid var(--legal-rule);
    border-radius: 0.75rem;
    overflow: hidden;
    font-size: 0.925rem;
}

.legal-content dl.legal-identity dt,
.legal-content dl.legal-identity dd {
    margin: 0;
    padding: 0.5rem 0.85rem;
    border-bottom: 1px solid var(--legal-rule);
}

.legal-content dl.legal-identity dt { background: var(--legal-fill); font-weight: 600; }
.legal-content dl.legal-identity dt:last-of-type,
.legal-content dl.legal-identity dd:last-of-type { border-bottom: 0; }

.legal-content .legal-note {
    margin: 1rem 0;
    padding: 0.85rem 1rem;
    border-left: 3px solid var(--legal-link);
    background: var(--legal-fill);
    border-radius: 0 0.5rem 0.5rem 0;
}

.legal-content .legal-annex table { display: table; }

@media (max-width: 640px) {
    .legal-content dl.legal-identity { grid-template-columns: 1fr; }
    .legal-content dl.legal-identity dt { border-bottom: 0; padding-bottom: 0.15rem; }
    .legal-content .legal-annex table { display: block; }
}

@media print {
    #site-header, footer, .legal-no-print { display: none !important; }
    body { background: #fff !important; }
    .legal-content { font-size: 11pt; color: #000; }
    .legal-content a { color: #000; }
}
