/* CallPing cookie banner CSS — shared between website + status static surfaces.
 *
 * Implements docs/design/visual-refresh-spec.md §3.6 visual contract.
 * Sourced via <link rel="stylesheet" href="/cookie-banner.css">.
 *
 * All colors come from the BRAND.md tokens (--cp-primary, --cp-surface, etc.)
 * defined in each surface's :root.
 */

/* ── Banner toast (bottom of viewport) ───────────────────────────────── */
#cp-cookie-banner {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  z-index: 50;
  max-width: 800px;
  margin: 0 auto;
  background: var(--cp-surface);
  border: 1px solid var(--cp-border);
  border-radius: 12px;
  box-shadow: 0 8px 32px -8px rgba(0,0,0,0.4);
}
.cp-cookie-inner { padding: 20px 24px; }
.cp-cookie-copy {
  font-size: 14px;
  line-height: 1.5;
  color: var(--cp-fg);
  margin: 0 0 16px;
}
.cp-cookie-copy a { color: var(--cp-info); text-decoration: none; }
.cp-cookie-copy a:hover { text-decoration: underline; }
.cp-cookie-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* ── Buttons (banner + modal share) ─────────────────────────────────── */
.cp-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: background-color 0.2s, border-color 0.2s;
}
.cp-btn-primary {
  background: var(--cp-primary);
  color: #0F172A; /* literal — NEVER var(--cp-fg) — visual-spec-v1.md §0.7 (dark on orange WCAG AA) */
  font-weight: 600;
}
.cp-btn-primary:hover { background: var(--cp-primary-hover); }
.cp-btn-secondary {
  background: var(--cp-surface);
  border: 1px solid var(--cp-border);
  color: var(--cp-fg);
  font-weight: 500;
}
.cp-btn-secondary:hover { background: var(--cp-surface-2); }
.cp-btn-ghost {
  background: transparent;
  color: var(--cp-fg);
  font-weight: 500;
}
.cp-btn-ghost:hover { background: var(--cp-surface-2); }

@media (max-width: 640px) {
  .cp-cookie-actions { flex-direction: column; align-items: stretch; }
  .cp-cookie-actions .cp-btn { width: 100%; }
}

/* ── Modal (overlay + card) ─────────────────────────────────────────── */
#cp-cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.cp-cookie-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  border: none;
  padding: 0;
  cursor: pointer;
}
.cp-cookie-modal-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--cp-surface);
  border: 1px solid var(--cp-border);
  border-radius: 12px;
  box-shadow: 0 8px 32px -8px rgba(0,0,0,0.5);
}
.cp-cookie-modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--cp-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cp-cookie-modal-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--cp-fg);
  margin: 0;
}
.cp-cookie-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--cp-muted);
  padding: 0;
  line-height: 0;
}
.cp-cookie-modal-close:hover { color: var(--cp-fg); }

.cp-cookie-modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cp-cookie-card {
  background: var(--cp-surface-2);
  border-radius: 8px;
  padding: 16px;
}
.cp-cookie-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.cp-cookie-card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--cp-fg);
}
.cp-cookie-card-desc {
  font-size: 12px;
  color: var(--cp-muted);
  line-height: 1.5;
  margin: 0;
}
.cp-cookie-foot-link {
  font-size: 12px;
  color: var(--cp-muted);
  margin: 8px 0 0;
}
.cp-cookie-foot-link a { color: var(--cp-info); text-decoration: none; }
.cp-cookie-foot-link a:hover { text-decoration: underline; }

.cp-cookie-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--cp-border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ── Toggle (input[type=checkbox] hidden, .cp-toggle-slider visible) ── */
.cp-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.cp-toggle input { opacity: 0; width: 0; height: 0; }
.cp-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--cp-surface);
  border: 1px solid var(--cp-border);
  border-radius: 24px;
  transition: background-color 0.2s, border-color 0.2s;
}
.cp-toggle-slider::before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  top: 3px;
  background: var(--cp-muted);
  border-radius: 50%;
  transition: transform 0.2s, background-color 0.2s;
}
.cp-toggle input:checked + .cp-toggle-slider {
  background: var(--cp-primary);
  border-color: var(--cp-primary);
}
.cp-toggle input:checked + .cp-toggle-slider::before {
  transform: translateX(19px);
  background: #0F172A; /* literal — NEVER var(--cp-fg) — visual-spec-v1.md §0.7 (dark indicator on orange) */
}
.cp-toggle-locked { opacity: 0.6; cursor: not-allowed; }
.cp-toggle-locked .cp-toggle-slider { cursor: not-allowed; }
