/* Dipendenti.it — Consent banner & modal */

#consent-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 9999;
    background: #fff;
    border-top: 4px solid var(--primary, #1B4B8A);
    box-shadow: 0 -8px 32px rgba(0,0,0,0.15);
    color: #1a1a1a;
    font-family: inherit;
    padding: 18px 16px;
    animation: consent-slide-up .3s ease-out;
}
@keyframes consent-slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.consent-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: center;
    justify-content: space-between;
}
.consent-banner-text {
    flex: 1 1 480px;
    min-width: 0;
}
.consent-banner-text h2 {
    font-size: 18px;
    margin: 0 0 6px;
    color: var(--primary-dark, #0F2E5A);
}
.consent-banner-text p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}
.consent-banner-text a {
    color: var(--primary, #1B4B8A);
    font-weight: 600;
    text-decoration: underline;
}
.consent-banner-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.consent-btn {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s, transform .05s;
}
.consent-btn:active { transform: translateY(1px); }
.consent-btn-accept {
    background: var(--primary, #1B4B8A);
    color: #fff;
}
.consent-btn-accept:hover { background: var(--primary-dark, #0F2E5A); }
.consent-btn-reject {
    background: #f1f3f6;
    color: #1a1a1a;
    border: 1px solid #d6dae0;
}
.consent-btn-reject:hover { background: #e6e9ee; }
.consent-btn-customize {
    background: transparent;
    color: var(--primary, #1B4B8A);
    text-decoration: underline;
    padding: 11px 12px;
    font-weight: 600;
}
.consent-btn-customize:hover { color: var(--primary-dark, #0F2E5A); }
.consent-btn-save {
    background: var(--primary, #1B4B8A);
    color: #fff;
}

/* Modal */
#consent-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.consent-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 46, 90, 0.55);
    backdrop-filter: blur(2px);
}
.consent-modal-box {
    position: relative;
    background: #fff;
    border-radius: 16px;
    max-width: 640px;
    width: 100%;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 80px rgba(0,0,0,0.35);
}
.consent-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid #e8eaee;
}
.consent-modal-header h2 {
    font-size: 19px;
    margin: 0;
    color: var(--primary-dark, #0F2E5A);
}
.consent-modal-close {
    appearance: none;
    border: 0;
    background: transparent;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: #555;
    padding: 4px 10px;
    border-radius: 6px;
}
.consent-modal-close:hover { background: #f1f3f6; }
.consent-modal-body {
    padding: 18px 22px;
    overflow-y: auto;
    color: #1a1a1a;
    font-size: 14px;
    line-height: 1.55;
}
.consent-modal-body > p {
    margin: 0 0 14px;
}
.consent-cat {
    border: 1px solid #e8eaee;
    border-radius: 12px;
    padding: 14px 16px;
    margin: 12px 0;
}
.consent-cat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}
.consent-cat-head h3 {
    font-size: 15px;
    margin: 0;
    color: var(--primary-dark, #0F2E5A);
}
.consent-cat p {
    margin: 0;
    color: #444;
    font-size: 13px;
}
.consent-toggle {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}
.consent-toggle input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}
.consent-toggle-slider {
    display: block;
    width: 44px;
    height: 24px;
    background: #d6dae0;
    border-radius: 999px;
    position: relative;
    transition: background .15s;
}
.consent-toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 20px; height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform .15s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.consent-toggle input:checked + .consent-toggle-slider {
    background: var(--primary, #1B4B8A);
}
.consent-toggle input:checked + .consent-toggle-slider::before {
    transform: translateX(20px);
}
.consent-toggle-locked {
    background: #f1f3f6;
    color: #555;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
}
.consent-modal-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 22px;
    border-top: 1px solid #e8eaee;
    background: #fafbfc;
}

/* Footer trigger */
.consent-preferences-link {
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

/* Mobile */
@media (max-width: 720px) {
    .consent-banner-inner { flex-direction: column; align-items: stretch; }
    .consent-banner-actions { justify-content: stretch; }
    .consent-banner-actions .consent-btn { flex: 1 1 auto; }
    .consent-modal-footer { flex-direction: column; }
    .consent-modal-footer .consent-btn { width: 100%; }
}
