/* ==========================================================================
   JOB LEADER — Cookie consent + GDPR layer (shared)
   Namespaced .jl-cc-* to avoid collisions with Tailwind / page styles.
   Brand: #1e50bc. Accessible, mobile-safe, no dark patterns.
   ========================================================================== */
:root{
  --jlcc-blue:#1e50bc;
  --jlcc-blue-dark:#173f96;
  --jlcc-ink:#1a1f2e;
  --jlcc-muted:#5a6473;
  --jlcc-line:#e3e7ef;
  --jlcc-soft:#f5f7fb;
}

.jl-cc-hidden{ display:none !important; }

/* ---- Overlay (only for the settings panel, never blocks the bar) ---- */
.jl-cc-overlay{
  position:fixed; inset:0; z-index:2147483000;
  background:rgba(12,18,32,.55); backdrop-filter:blur(2px);
  display:flex; align-items:center; justify-content:center; padding:20px;
}

/* ---- Bottom consent bar ---- */
.jl-cc-bar{
  position:fixed; left:0; right:0; bottom:0; z-index:2147483001;
  background:#fff; color:var(--jlcc-ink);
  border-top:1px solid var(--jlcc-line);
  box-shadow:0 -10px 40px rgba(15,23,42,.16);
  padding:18px clamp(16px,4vw,40px);
  font-family:'Segoe UI',-apple-system,BlinkMacSystemFont,Roboto,Helvetica,sans-serif;
  animation:jlcc-rise .35s cubic-bezier(.25,.46,.45,.94);
  /* never taller than the viewport — scroll inside if content + buttons don't fit (small phones) */
  max-height:90vh; max-height:90dvh; overflow-y:auto; -webkit-overflow-scrolling:touch;
  box-sizing:border-box;
}
@keyframes jlcc-rise{ from{ transform:translateY(100%);} to{ transform:translateY(0);} }
.jl-cc-bar__inner{
  max-width:1180px; margin:0 auto;
  display:flex; align-items:center; gap:20px 32px; flex-wrap:wrap;
}
.jl-cc-bar__text{ flex:1 1 420px; min-width:280px; }
.jl-cc-bar__title{ margin:0 0 4px; font-size:1.02rem; font-weight:800; letter-spacing:-.01em; }
.jl-cc-bar__body{ margin:0; font-size:.86rem; line-height:1.55; color:var(--jlcc-muted); }
.jl-cc-bar__body a{ color:var(--jlcc-blue); font-weight:600; text-decoration:none; }
.jl-cc-bar__body a:hover{ text-decoration:underline; }
.jl-cc-bar__actions{ display:flex; gap:10px; flex:0 0 auto; flex-wrap:wrap; }

/* ---- Buttons (Accept / Reject equal weight = no dark pattern) ---- */
.jl-cc-btn{
  font:inherit; font-weight:700; font-size:.86rem;
  padding:11px 22px; border-radius:10px; cursor:pointer;
  border:1.5px solid transparent; transition:background .2s,box-shadow .2s,opacity .2s,color .2s;
  white-space:nowrap;
}
.jl-cc-btn:focus-visible{ outline:3px solid rgba(30,80,188,.4); outline-offset:2px; }
.jl-cc-btn--primary{ background:var(--jlcc-blue); color:#fff; }
.jl-cc-btn--primary:hover{ background:var(--jlcc-blue-dark); box-shadow:0 4px 14px rgba(30,80,188,.32); }
/* Reject is visually equal to Accept (same size/weight/contrast) */
.jl-cc-btn--equal{ background:#eef2fb; color:var(--jlcc-blue-dark); border-color:#d6e0f5; }
.jl-cc-btn--equal:hover{ background:#e2e9f8; }
.jl-cc-btn--ghost{ background:transparent; color:var(--jlcc-muted); border-color:var(--jlcc-line); }
.jl-cc-btn--ghost:hover{ background:var(--jlcc-soft); color:var(--jlcc-ink); }

/* ---- Settings panel ---- */
.jl-cc-panel{
  background:#fff; color:var(--jlcc-ink);
  width:min(640px,100%); max-height:88vh; overflow-y:auto;
  border-radius:18px; box-shadow:0 24px 70px rgba(15,23,42,.34);
  font-family:'Segoe UI',-apple-system,BlinkMacSystemFont,Roboto,Helvetica,sans-serif;
}
.jl-cc-panel__head{
  display:flex; align-items:flex-start; justify-content:space-between; gap:16px;
  padding:24px 26px 16px; border-bottom:1px solid var(--jlcc-line);
}
.jl-cc-panel__title{ margin:0; font-size:1.25rem; font-weight:800; letter-spacing:-.01em; }
.jl-cc-panel__sub{ margin:6px 0 0; font-size:.84rem; color:var(--jlcc-muted); line-height:1.5; }
.jl-cc-panel__close{
  flex:0 0 auto; background:var(--jlcc-soft); border:none; width:36px; height:36px;
  border-radius:50%; font-size:1.2rem; line-height:1; color:var(--jlcc-muted); cursor:pointer;
}
.jl-cc-panel__close:hover{ background:#e6eaf2; color:var(--jlcc-ink); }
.jl-cc-panel__body{ padding:8px 26px 4px; }
.jl-cc-panel__foot{
  position:sticky; bottom:0; background:#fff;
  padding:16px 26px 22px; border-top:1px solid var(--jlcc-line);
  display:flex; justify-content:flex-end; gap:10px; flex-wrap:wrap;
}

/* ---- Category row ---- */
.jl-cc-cat{ padding:18px 0; border-bottom:1px solid var(--jlcc-line); }
.jl-cc-cat:last-child{ border-bottom:none; }
.jl-cc-cat__top{ display:flex; align-items:center; justify-content:space-between; gap:14px; }
.jl-cc-cat__name{ font-size:.98rem; font-weight:700; }
.jl-cc-cat__locked{ font-size:.72rem; font-weight:700; color:var(--jlcc-blue); text-transform:uppercase; letter-spacing:.06em; }
.jl-cc-cat__desc{ margin:8px 0 0; font-size:.84rem; color:var(--jlcc-muted); line-height:1.55; }

/* ---- Toggle switch ---- */
.jl-cc-switch{ position:relative; display:inline-block; width:46px; height:26px; flex:0 0 auto; }
.jl-cc-switch input{ position:absolute; opacity:0; width:0; height:0; }
.jl-cc-slider{
  position:absolute; inset:0; cursor:pointer; background:#cbd3e1; border-radius:26px; transition:background .25s;
}
.jl-cc-slider::before{
  content:""; position:absolute; height:20px; width:20px; left:3px; top:3px;
  background:#fff; border-radius:50%; transition:transform .25s; box-shadow:0 1px 3px rgba(0,0,0,.25);
}
.jl-cc-switch input:checked + .jl-cc-slider{ background:var(--jlcc-blue); }
.jl-cc-switch input:checked + .jl-cc-slider::before{ transform:translateX(20px); }
.jl-cc-switch input:disabled + .jl-cc-slider{ background:var(--jlcc-blue); opacity:.5; cursor:not-allowed; }
.jl-cc-switch input:focus-visible + .jl-cc-slider{ outline:3px solid rgba(30,80,188,.4); outline-offset:2px; }

/* ---- Registration consent checkbox (separate from cookies) ---- */
.jl-consent{
  display:flex; align-items:flex-start; gap:10px; margin:2px 0 4px;
  font-size:.8rem; line-height:1.5; color:#4b5563; text-align:left;
}
.jl-consent input[type="checkbox"]{
  flex:0 0 auto; width:17px; height:17px; margin-top:2px; accent-color:var(--jlcc-blue); cursor:pointer;
}
.jl-consent a{ color:var(--jlcc-blue); font-weight:600; text-decoration:none; }
.jl-consent a:hover{ text-decoration:underline; }

/* ---- Chat disclaimer ---- */
.jl-chat-disclaimer{
  font-size:.68rem; line-height:1.4; color:#9ca3af; text-align:center;
  padding:6px 12px 0;
}
.jl-chat-disclaimer a{ color:var(--jlcc-blue); text-decoration:none; }
.jl-chat-disclaimer a:hover{ text-decoration:underline; }

@media (max-width:640px){
  /* respect iOS home-indicator safe area so buttons stay tappable */
  .jl-cc-bar{ padding-bottom:max(18px, env(safe-area-inset-bottom)); }
  .jl-cc-bar__inner{ gap:14px; }
  .jl-cc-bar__actions{ width:100%; }
  .jl-cc-bar__actions .jl-cc-btn{ flex:1 1 140px; text-align:center; min-height:44px; }
}
