/* Cookie consent banner + settings panel. Uses the existing design tokens
   (site.css :root) so it matches the rest of the site without a new
   visual language. */

.consentbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 8500;
  padding: var(--space-4) var(--space-5) calc(var(--space-4) + env(safe-area-inset-bottom));
  background: rgba(10,15,26,0.92); backdrop-filter: blur(10px); border-top: 1px solid var(--border-strong);
  animation: consentIn var(--dur-slow, .3s) var(--ease-spring, ease) both; }
@keyframes consentIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.consentbar__inner { max-width: 1120px; margin: 0 auto; display: flex; gap: var(--space-6); align-items: center; flex-wrap: wrap; justify-content: space-between; }
.consentbar__copy { flex: 1 1 360px; min-width: 260px; }
.consentbar__title { display: block; color: var(--ink); font-size: var(--text-body); margin-bottom: var(--space-2); }
.consentbar__body { color: var(--gray-600); font-size: var(--text-small); line-height: 1.5; margin: 0 0 var(--space-2); max-width: 62ch; }
.consentbar__link { color: var(--accent-400); font-size: var(--text-small); text-decoration: underline; text-underline-offset: 3px; }
.consentbar__actions { display: flex; gap: var(--space-3); flex-wrap: wrap; flex: 0 0 auto; }
.consentbar__actions .btn { padding: 0.65rem 1.15rem; font-size: var(--text-small); }

.consentmodal { position: fixed; inset: 0; z-index: 9100; display: grid; place-items: center; padding: var(--space-5);
  background: rgba(10,15,26,0.6); backdrop-filter: blur(4px); }
.consentmodal__card { position: relative; width: min(480px, 100%); max-height: min(640px, 86vh); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: var(--space-7);
  box-shadow: var(--shadow-xl); animation: pop var(--dur-slow, .3s) var(--ease-spring, ease) both; }
.consentmodal__close { position: absolute; top: var(--space-4); right: var(--space-4); width: 32px; height: 32px;
  border-radius: 50%; border: 1px solid var(--border); background: rgba(255,255,255,0.04); color: var(--gray-600);
  cursor: pointer; font-size: 0.9rem; line-height: 1; }
.consentmodal__title { color: var(--ink); margin: 0 var(--space-7) var(--space-5) 0; }
.consentmodal__actions { margin-top: var(--space-6); display: flex; justify-content: flex-end; }

.consentrow { padding: var(--space-4) 0; border-top: 1px solid var(--border); }
.consentrow:first-child { border-top: none; padding-top: 0; }
.consentrow__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.consentrow__name { color: var(--ink); font-weight: 500; font-size: var(--text-small); }
.consentrow__desc { color: var(--gray-500); font-size: var(--text-micro); line-height: 1.5; margin: var(--space-2) 0 0; }

.consentrow__switch { position: relative; display: inline-block; width: 40px; height: 24px; flex: none; cursor: pointer; }
.consentrow__switch input { opacity: 0; width: 0; height: 0; }
.consentrow__slider { position: absolute; inset: 0; background: var(--gray-200); border-radius: var(--radius-full); transition: background .15s ease; }
.consentrow__slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
  background: var(--gray-800); border-radius: 50%; transition: transform .15s ease; }
.consentrow__switch input:checked + .consentrow__slider { background: var(--accent); }
.consentrow__switch input:checked + .consentrow__slider::before { transform: translateX(16px); background: #05121A; }
.consentrow__switch.is-locked { cursor: default; opacity: 0.55; }

.footer__link-btn { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: none; }
.footer__link-btn:hover { text-decoration: underline; }

/* The floating chat launcher (assets/js/chat.js) also anchors bottom-right;
   push it above the consent banner so it isn't hidden behind it. */
body.has-consentbar #phChatBtn { bottom: calc(var(--consentbar-h, 140px) + 14px) !important; }
body.has-consentbar #phChatTeaser { display: none !important; }

@media (max-width: 640px) {
  .consentbar__actions { width: 100%; }
  .consentbar__actions .btn { flex: 1 1 auto; justify-content: center; }
}
