/*
   Páginas de Términos y Condiciones / Aviso de Privacidad — override de
   `k2dj_agreements` (templates/k2dj_agreements/agreement_detail.html y
   agreement_acceptance.html).
*/
body[data-screen="legal"] {
    padding: 0;
}

.legal-shell {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    overflow: visible;
    max-width: var(--max-viewport);
    width: 100%;
    margin: 0 auto;
    padding: 16px 20px 20px;
    position: relative;
    background: var(--bg-neutro);
}
.legal-shell > form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.legal-page__brand {
    display: flex;
    justify-content: center;
    padding: 8px 0 20px;
    flex-shrink: 0;
}
.legal-page__logos { height: 44px; width: auto; }

.legal-page__title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 500;
    line-height: 1.1;
    text-transform: uppercase;
    color: var(--text-primary);
    text-align: center;
    margin: 0 0 16px;
    flex-shrink: 0;
}
.legal-page__title span { color: var(--papaya); }

/* Aviso "se actualizaron los términos" (agreement_acceptance.html cuando
   is_first_acceptance es False). */
.legal-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: var(--papaya-tint-04);
    border: 1px solid rgba(var(--papaya-rgb), 0.35);
    border-radius: var(--radius-card);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 16px;
    flex-shrink: 0;
}
.legal-notice svg { width: 20px; height: 20px; color: var(--papaya); flex-shrink: 0; margin-top: 1px; }

.legal-card {
    padding: 16px 18px;
    background: #141517;
    border: 1px solid #2E3134;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
    flex: 1 1 auto;
    min-height: 220px;
    max-height: clamp(292px, calc(55dvh + 32px), 672px);
    overflow: hidden;            /* el scroll vive en __body: la etiqueta queda fija */
}
.legal-card__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overflow-wrap: break-word;
    padding-right: 10px;         /* aire entre el texto y el thumb */
    scrollbar-gutter: stable;
    /* Scrollbar fino, mismos tonos que la tarjeta (Firefox) */
    scrollbar-width: thin;
    scrollbar-color: #2E3134 transparent;
}
/* WebKit / Blink */
.legal-card__body::-webkit-scrollbar { width: 6px; }
.legal-card__body::-webkit-scrollbar-track { background: transparent; }
.legal-card__body::-webkit-scrollbar-thumb {
    background: #2E3134;
    border-radius: 999px;
}
.legal-card__body::-webkit-scrollbar-thumb:hover { background: #45494E; }
.legal-card__label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-label);
    margin: 0;
}
.legal-card__meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0 0 4px;
    line-height: 1.5;
}
.legal-card__body { font-size: 14px; line-height: 1.6; color: var(--text-secondary); }
.legal-card__body h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 18px 0 6px;
}
.legal-card__body h3:first-child { margin-top: 0; }
.legal-card__body p { margin: 0 0 10px; }
.legal-card__body ul { margin: 0 0 10px; padding-left: 20px; }
.legal-card__body li { margin-bottom: 4px; }
.legal-card__body b, .legal-card__body strong { color: var(--text-primary); font-weight: 600; }

/* Checkbox de aceptación — mismo patrón visual que .consent-check de
   casting. */
.consent-check {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    background: var(--papaya-tint-04);
    border: 1px solid rgba(var(--papaya-rgb), 0.35);
    border-radius: var(--radius-card);
    cursor: pointer;
    margin-bottom: 12px;
    flex-shrink: 0;
}
.consent-check input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid var(--papaya);
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    position: relative;
    margin: 1px 0 0;
    flex-shrink: 0;
}
.consent-check input[type="checkbox"]:checked { background: var(--papaya); }
.consent-check input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #000;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}
.consent-check__text { font-size: 13px; line-height: 1.45; color: var(--text-primary); font-weight: 500; }

.legal-page__actions { display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; margin-top: 10px; }

.legal-already-accepted {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.3);
    border-radius: var(--radius-card);
    color: var(--status-approved);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    flex-shrink: 0;
}
.legal-already-accepted svg { width: 18px; height: 18px; flex-shrink: 0; }
