/* Cookie banner and preferences panel (cookie-consent.js).
   Single source of these styles: the server pages inline this file (backend/utils/cookie_banner.py),
   the application pages link it (frontend/index.html). The direction comes from <html dir>. */
#rc-banner{position:fixed;bottom:0;left:0;right:0;z-index:99999;background:#fff;box-shadow:0 -2px 16px rgba(0,0,0,.1);font-family:Inter,system-ui,-apple-system,sans-serif;font-size:14px;line-height:1.5;color:#374151;border-top:1px solid #e5e7eb;}
#rc-banner *{box-sizing:border-box;margin:0;}
#rc-banner-inner{max-width:1200px;margin:0 auto;padding:16px 24px;display:flex;align-items:center;gap:16px;flex-wrap:wrap;}
#rc-banner-text{flex:1;min-width:280px;}
#rc-banner-text h3{font-size:15px;font-weight:600;color:#111827;margin-bottom:4px;}
#rc-banner-text p{font-size:12px;color:#6b7280;margin:0;}
#rc-banner-actions{display:flex;gap:8px;flex-shrink:0;flex-wrap:wrap;}
.rc-btn{display:inline-flex;align-items:center;justify-content:center;padding:8px 20px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;border:none;transition:background .15s,color .15s,box-shadow .15s;white-space:nowrap;font-family:inherit;}
.rc-btn-primary{background:#2563EB;color:#fff;}
.rc-btn-primary:hover{background:#1D4ED8;}
.rc-btn-outline{background:#fff;color:#374151;border:1px solid #d1d5db;}
.rc-btn-outline:hover{background:#f9fafb;border-color:#9ca3af;}
.rc-btn-text{background:none;color:#6b7280;text-decoration:underline;padding:8px 12px;}
.rc-btn-text:hover{color:#374151;}
#rc-overlay{position:fixed;top:0;left:0;right:0;bottom:0;z-index:100000;background:rgba(0,0,0,.4);display:flex;align-items:center;justify-content:center;padding:16px;}
#rc-prefs{background:#fff;border-radius:12px;max-width:520px;width:100%;max-height:90vh;overflow-y:auto;box-shadow:0 20px 60px rgba(0,0,0,.2);font-family:Inter,system-ui,-apple-system,sans-serif;font-size:14px;color:#374151;}
#rc-prefs-header{padding:20px 24px 0;display:flex;align-items:center;justify-content:space-between;}
#rc-prefs-header h2{font-size:18px;font-weight:600;color:#111827;}
#rc-prefs-close{background:none;border:none;cursor:pointer;padding:4px;color:#9ca3af;font-size:20px;line-height:1;}
#rc-prefs-close:hover{color:#374151;}
#rc-prefs-body{padding:16px 24px 24px;}
.rc-cat{padding:16px 0;border-bottom:1px solid #f3f4f6;}
.rc-cat:last-child{border-bottom:none;}
.rc-cat-head{display:flex;align-items:center;justify-content:space-between;gap:12px;}
.rc-cat-info{flex:1;}
.rc-cat-name{font-size:14px;font-weight:600;color:#111827;}
.rc-cat-desc{font-size:12px;color:#9ca3af;margin-top:2px;}
.rc-toggle{position:relative;width:44px;height:24px;flex-shrink:0;}
.rc-toggle input{opacity:0;width:0;height:0;position:absolute;}
.rc-toggle-track{position:absolute;top:0;left:0;right:0;bottom:0;background:#d1d5db;border-radius:12px;cursor:pointer;transition:background .2s;}
.rc-toggle input:checked+.rc-toggle-track{background:#2563EB;}
.rc-toggle-thumb{position:absolute;top:2px;left:2px;width:20px;height:20px;background:#fff;border-radius:50%;transition:transform .2s;box-shadow:0 1px 3px rgba(0,0,0,.15);pointer-events:none;}
.rc-toggle input:checked~.rc-toggle-thumb{transform:translateX(20px);}
.rc-toggle-disabled .rc-toggle-track{background:#e5e7eb;cursor:not-allowed;}
.rc-toggle-disabled .rc-toggle-thumb{background:#f3f4f6;}
.rc-always{font-size:12px;color:#2563EB;font-weight:500;white-space:nowrap;}
#rc-prefs-footer{padding:0 24px 20px;display:flex;justify-content:flex-end;}
[dir=rtl] .rc-toggle-thumb{left:auto;right:2px;}
[dir=rtl] .rc-toggle input:checked~.rc-toggle-thumb{transform:translateX(-20px);}
/* Server-rendered banner: hidden until the inline check in the page finds no consent. */
#rc-banner[data-ssr]{display:none;}
.rc-need #rc-banner[data-ssr]{display:block;}
/* Compact on phones (audit n° 54): accept and reject share one row, "customize" is a text link
   under them, and the title gives way to the sentence. */
@media(max-width:640px){
  #rc-banner-inner{flex-direction:column;align-items:stretch;gap:10px;padding:12px 16px;}
  #rc-banner-text{min-width:0;}
  #rc-banner-text h3{display:none;}
  #rc-banner-actions{flex-direction:row;}
  #rc-banner-actions .rc-btn-primary,#rc-banner-actions .rc-btn-outline{flex:1 1 0;padding:8px 10px;}
  #rc-banner-actions .rc-btn-text{flex:1 1 100%;padding:2px 8px;}
  .rc-btn{justify-content:center;}
  #rc-prefs{max-width:100%;border-radius:12px 12px 0 0;position:fixed;bottom:0;max-height:85vh;}
}
