/* ─── AstraShield Cookies v1.1 ──────────────────────────────────────────────── */

:root {
  --asc-accent:  #2563eb;
  --asc-radius:  16px;
  --asc-width:   340px;
  --asc-shadow:  0 8px 32px rgba(0,0,0,.45);
  --asc-glass:   rgba(13, 18, 38, 0.88);
}

/* ── Banner ─────────────────────────────────────────────────────────────────── */

.asc-banner {
  position: fixed;
  z-index: 99998;
  width: var(--asc-width);
  max-width: calc(100vw - 32px);
  font-family: var(--font-body, system-ui, sans-serif);
  font-size: 14px;
  line-height: 1.5;
  color: #f0f4ff;

  background: var(--asc-glass);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--asc-radius);
  box-shadow: var(--asc-shadow), inset 0 1px 0 rgba(255,255,255,.07);

  opacity: 0;
  transform: translateY(20px) scale(.97);
  pointer-events: none;
  transition: opacity .35s ease, transform .35s cubic-bezier(.34,1.56,.64,1);
}

.asc-banner.asc-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.asc-banner.asc-hiding {
  opacity: 0;
  transform: translateY(14px) scale(.96);
  transition: opacity .22s ease, transform .22s ease;
  pointer-events: none;
}

/* Thin top accent line */
.asc-banner::before {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--asc-accent), transparent);
  border-radius: var(--asc-radius) var(--asc-radius) 0 0;
  opacity: .75;
}

/* Positions */
.asc-banner--bottom-right  { bottom: 24px; right:  24px; }
.asc-banner--bottom-left   { bottom: 24px; left:   24px; }
.asc-banner--bottom-center { bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px) scale(.97); }
.asc-banner--bottom-center.asc-visible { transform: translateX(-50%) translateY(0) scale(1); }
.asc-banner--bottom-center.asc-hiding  { transform: translateX(-50%) translateY(14px) scale(.96); }

.asc-inner { padding: 18px 20px 16px; }

.asc-title {
  margin: 0 0 7px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.01em;
}

.asc-text {
  margin: 0 0 10px;
  color: rgba(200,215,255,.82);
  font-size: 13px;
}

.asc-policy-link {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--asc-accent);
  text-decoration: none;
  opacity: .85;
  transition: opacity .2s;
}
.asc-policy-link:hover { opacity: 1; text-decoration: underline; }

/* Secondary row : policy link + prefs text-link */
.asc-secondary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-bottom: 12px;
}

.asc-prefs-link {
  background: none;
  border: none;
  padding: 0;
  color: rgba(200,215,255,.65);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .2s;
  line-height: 1.4;
}
.asc-prefs-link:hover { color: #fff; }

/* Banner action row — 2 buttons only */
.asc-actions {
  display: flex;
  gap: 8px;
}
.asc-actions .asc-btn { flex: 1; }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */

.asc-btn {
  padding: 8px 10px;
  border: none;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s, transform .15s;
  white-space: nowrap;
  line-height: 1.3;
}
.asc-btn:hover  { opacity: .85; transform: translateY(-1px); }
.asc-btn:active { transform: translateY(0); }

.asc-btn--accept {
  background: var(--asc-accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(79,142,247,.3);
}

.asc-btn--ghost {
  background: rgba(255,255,255,.07);
  color: rgba(200,215,255,.75);
  border: 1px solid rgba(255,255,255,.11);
}
.asc-btn--ghost:hover { background: rgba(255,255,255,.13); color: #fff; }

/* ── Overlay ─────────────────────────────────────────────────────────────────── */

.asc-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;

  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.asc-overlay.asc-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── Modal ───────────────────────────────────────────────────────────────────── */

.asc-modal {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;

  background: rgba(13, 18, 40, 0.97);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.07);
  color: #f0f4ff;
  font-family: var(--font-body, system-ui, sans-serif);

  transform: translateY(20px) scale(.97);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.asc-overlay.asc-visible .asc-modal {
  transform: translateY(0) scale(1);
}

/* Accent line */
.asc-modal::before {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--asc-accent), transparent);
  border-radius: 20px 20px 0 0;
  opacity: .7;
}

.asc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.asc-modal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.01em;
}

.asc-modal-close {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  color: rgba(200,215,255,.7);
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  transition: background .2s, color .2s;
  flex-shrink: 0;
}
.asc-modal-close:hover { background: rgba(255,255,255,.15); color: #fff; }

.asc-modal-body {
  padding: 18px 22px;
}

.asc-modal-intro {
  margin: 0 0 18px;
  font-size: 13px;
  color: rgba(200,215,255,.75);
  line-height: 1.6;
}

/* ── Category accordion ──────────────────────────────────────────────────────── */

.asc-cat {
  border-top: 1px solid rgba(255,255,255,.07);
}
.asc-cat:last-child { border-bottom: 1px solid rgba(255,255,255,.07); }

/* Header row — flex, always visible */
.asc-cat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
}

/* Expand button — takes up the name+desc area */
.asc-cat-expand {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  color: inherit;
  min-width: 0;
}
.asc-cat-expand:hover .asc-chevron { color: #fff; }

/* Rotating chevron */
.asc-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 16px;
  line-height: 1;
  color: rgba(200,215,255,.45);
  flex-shrink: 0;
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), color .2s;
}
.asc-cat-expand[aria-expanded="true"] .asc-chevron {
  transform: rotate(90deg);
  color: var(--asc-accent);
}

.asc-cat-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.asc-cat-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  display: block;
}

.asc-cat-desc {
  font-size: 12px;
  color: rgba(200,215,255,.6);
  line-height: 1.4;
}

/* "Toujours actifs" badge */
.asc-always-on {
  font-size: 11px;
  font-weight: 600;
  color: #4ade80;
  background: rgba(74,222,128,.12);
  border: 1px solid rgba(74,222,128,.25);
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Accordion detail panel ──────────────────────────────────────────────────── */

.asc-cat-detail {
  padding: 0 0 14px 30px;
  overflow: hidden;
}
.asc-cat-detail[hidden] { display: none; }

/* Cookie table inside accordion */
.asc-ck-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  color: rgba(200,215,255,.8);
}
.asc-ck-table thead th {
  text-align: left;
  padding: 5px 8px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: rgba(200,215,255,.45);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.asc-ck-table tbody td {
  padding: 6px 8px;
  vertical-align: top;
  border-bottom: 1px solid rgba(255,255,255,.04);
  line-height: 1.4;
}
.asc-ck-table tbody tr:last-child td { border-bottom: none; }
.asc-ck-table code {
  background: rgba(255,255,255,.07);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px;
  color: var(--asc-accent);
}
.asc-no-cookies {
  margin: 0;
  font-size: 12px;
  color: rgba(200,215,255,.5);
  font-style: italic;
  padding: 4px 0;
}

/* ── Toggle switch ───────────────────────────────────────────────────────────── */

.asc-toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.asc-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.asc-toggle-thumb {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 24px;
  transition: background .22s, border-color .22s;
}
.asc-toggle-thumb::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(200,215,255,.55);
  transition: left .22s cubic-bezier(.34,1.56,.64,1), background .22s;
}

.asc-toggle-switch input:checked ~ .asc-toggle-thumb {
  background: var(--asc-accent);
  border-color: var(--asc-accent);
}
.asc-toggle-switch input:checked ~ .asc-toggle-thumb::after {
  left: calc(100% - 19px);
  background: #fff;
}

.asc-toggle-switch input:focus-visible ~ .asc-toggle-thumb {
  outline: 2px solid var(--asc-accent);
  outline-offset: 2px;
}

/* ── Modal footer ────────────────────────────────────────────────────────────── */

.asc-modal-footer {
  display: flex;
  gap: 8px;
  padding: 14px 22px 20px;
  border-top: 1px solid rgba(255,255,255,.07);
  flex-wrap: wrap;
}

.asc-modal-footer .asc-btn { flex: 1; min-width: 100px; }

/* ── Mobile ──────────────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  .asc-banner--bottom-right,
  .asc-banner--bottom-left,
  .asc-banner--bottom-center {
    bottom: 0; left: 0; right: 0;
    width: 100%; max-width: 100%;
    border-radius: var(--asc-radius) var(--asc-radius) 0 0;
    transform: translateY(100%);
  }
  .asc-banner.asc-visible { transform: translateY(0); }
  .asc-banner.asc-hiding  { transform: translateY(100%); }

  .asc-modal-footer .asc-btn:last-child { flex: 100%; }
}
