/* ConsentPilot in the Zohra design system: flat colours, square corners, the mascot peeking.
   Replaces the plugin stylesheet (see inc/consent.php). */

.consentpilot-banner, .consentpilot-modal, .consentpilot-embed { font-family: var(--f-sans); color: var(--cacao); line-height: 1.5; -webkit-font-smoothing: antialiased; }
.consentpilot-banner *, .consentpilot-modal *, .consentpilot-embed * { box-sizing: border-box; }
.consentpilot-banner[hidden], .consentpilot-modal[hidden], .consentpilot-floating-btn { display: none !important; }
.consentpilot-banner h2, .consentpilot-banner p, .consentpilot-modal h2, .consentpilot-modal h3, .consentpilot-modal p { margin: 0; }

/* Shared bits ---------------------------------------------------------------- */
.consentpilot-kicker { font-weight: 600; font-size: 11.5px; line-height: 1.3; letter-spacing: .14em; text-transform: uppercase; color: var(--praline); }
.consentpilot-btn, .consentpilot-embed__btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 48px; padding: 0 18px; border: 1.5px solid var(--cacao); border-radius: 0;
	font: 600 15px/1.2 var(--f-sans); text-decoration: none; cursor: pointer;
	transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s var(--ease-pop);
}
.consentpilot-btn:active, .consentpilot-embed__btn:active { transform: scale(.96); }
.consentpilot-btn:focus-visible, .consentpilot-modal__close:focus-visible, .consentpilot-banner__link:focus-visible, .consentpilot-toggle input:focus-visible + .consentpilot-toggle__slider, .consentpilot-embed__btn:focus-visible { outline: 3px solid var(--praline); outline-offset: 2px; }
/* Accept and refuse look the same: refusing is as easy as accepting. */
.consentpilot-btn--accept, .consentpilot-btn--reject, .consentpilot-btn--save, .consentpilot-embed__btn { background: var(--cacao); color: var(--farine); }
.consentpilot-btn--accept:hover, .consentpilot-btn--reject:hover, .consentpilot-btn--save:hover, .consentpilot-embed__btn:hover { background: var(--praline); border-color: var(--praline); color: var(--sucre); }
.consentpilot-btn--ghost { background: transparent; color: var(--cacao); }
.consentpilot-btn--ghost:hover { background: var(--cacao); color: var(--farine); }
.consentpilot-btn--outline { grid-column: 1 / -1; min-height: 44px; border: 0; background: none; color: var(--cacao); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 5px; }
.consentpilot-btn--outline:hover { color: var(--praline); text-underline-offset: 8px; }

/* Banner ----------------------------------------------------------------------- */
.consentpilot-banner { position: fixed; left: 16px; bottom: 16px; z-index: 130; width: min(470px, calc(100vw - 32px)); animation: cpz-in .6s var(--ease-pop) .4s both; }
.consentpilot-banner__inner { position: relative; display: flex; flex-direction: column; gap: 18px; padding: 24px 24px 18px; background: var(--sucre); border: 1.5px solid var(--cacao); }
.consentpilot-banner__inner::before { content: ""; position: absolute; right: 20px; bottom: calc(100% - 2px); width: 104px; height: 74px; background: var(--cp-mascot) 50% 0 / 100% auto no-repeat; transform-origin: 50% 100%; animation: cpz-peek .7s var(--ease-pop) 1s both; }
.consentpilot-banner:has(.consentpilot-btn--accept:hover) .consentpilot-banner__inner::before { animation: cpz-hop .6s var(--ease-pop); }
.consentpilot-banner:has(.consentpilot-btn--reject:hover) .consentpilot-banner__inner::before { animation: cpz-sulk .6s ease; }
.consentpilot-banner__content { display: flex; flex-direction: column; gap: 10px; padding-right: 8px; }
.consentpilot-banner__title { font-family: var(--f-display); font-weight: 600; font-size: 28px; line-height: 1.02; letter-spacing: -0.01em; }
.consentpilot-banner__text { font-size: 15px; line-height: 1.55; color: var(--cacao-doux); }
.consentpilot-banner__link, .consentpilot-modal__privacy a { align-self: flex-start; color: var(--praline); font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }
.consentpilot-banner__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Preferences window ---------------------------------------------------------- */
.consentpilot-modal { position: fixed; inset: 0; z-index: 210; display: grid; place-items: center; padding: 16px; }
.consentpilot-modal__overlay { position: absolute; inset: 0; background: rgba(43, 24, 16, .55); animation: zh-fade .25s ease; }
.consentpilot-modal__dialog { position: relative; width: min(620px, 100%); max-height: min(90vh, 780px); display: flex; flex-direction: column; background: var(--farine); border: 1.5px solid var(--cacao); animation: cpz-in .45s var(--ease-pop); }
.consentpilot-modal__header { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; min-height: 112px; padding: 22px 22px 20px; background: var(--rose); }
.consentpilot-modal__header::after { content: ""; position: absolute; right: 78px; bottom: 0; width: 96px; height: 80px; background: var(--cp-mascot-look) 50% 0 / 100% auto no-repeat; pointer-events: none; }
.consentpilot-modal__header > div { display: flex; flex-direction: column; gap: 6px; padding-right: 110px; }
.consentpilot-modal__header .consentpilot-kicker { color: var(--cacao); }
.consentpilot-modal__title { font-family: var(--f-display); font-weight: 600; font-size: clamp(26px, 4vw, 34px); line-height: 1; }
.consentpilot-modal__close { flex: none; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; background: var(--cacao); color: var(--farine); cursor: pointer; transition: transform .25s var(--ease-pop); }
.consentpilot-modal__close:hover { transform: rotate(90deg); }
.consentpilot-modal__body { display: flex; flex-direction: column; gap: 10px; overflow: auto; padding: 20px 22px; }
.consentpilot-modal__intro { font-size: 15px; line-height: 1.55; color: var(--cacao-doux); margin-bottom: 4px !important; }
.consentpilot-modal__category { --cat: #9DB356; padding: 16px 16px 16px 20px; background: var(--sucre); border-left: 8px solid var(--cat); animation: zh-rise .35s var(--ease-out) both; }
.consentpilot-modal__category:nth-of-type(2) { --cat: #E2A23A; animation-delay: .05s; }
.consentpilot-modal__category:nth-of-type(3) { --cat: #E9839B; animation-delay: .1s; }
.consentpilot-modal__category:nth-of-type(4) { --cat: #1F6B66; animation-delay: .15s; }
.consentpilot-modal__category:nth-of-type(5) { --cat: #C9773B; animation-delay: .2s; }
.consentpilot-modal__category-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.consentpilot-modal__category-control { display: flex; align-items: center; gap: 10px; }
.consentpilot-modal__category-title { font-family: var(--f-display); font-weight: 600; font-size: 20px; line-height: 1.15; }
.consentpilot-modal__category-desc { margin-top: 6px !important; font-size: 14px; line-height: 1.55; color: var(--cacao-doux); }
.consentpilot-modal__badge { padding: 6px 9px; background: var(--cacao); color: var(--farine); font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.consentpilot-modal__privacy { margin-top: 6px !important; }

/* Square switch. */
.consentpilot-toggle { position: relative; flex: none; display: inline-block; width: 58px; height: 32px; }
.consentpilot-toggle:has(input:disabled) { display: none; }
.consentpilot-toggle input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.consentpilot-toggle__slider { position: absolute; inset: 0; background: var(--kraft); border: 1.5px solid var(--cacao); transition: background .2s ease; }
.consentpilot-toggle__slider::before { content: ""; position: absolute; top: 4px; left: 4px; width: 21px; height: 21px; background: var(--cacao); transition: transform .35s var(--ease-pop), background .2s ease; }
.consentpilot-toggle input:checked + .consentpilot-toggle__slider { background: var(--cat, var(--cacao)); }
.consentpilot-toggle input:checked + .consentpilot-toggle__slider::before { transform: translateX(26px); background: var(--cacao); }
.consentpilot-toggle:hover .consentpilot-toggle__slider::before { transform: scale(.9); }
.consentpilot-toggle:hover input:checked + .consentpilot-toggle__slider::before { transform: translateX(26px) scale(.9); }

.consentpilot-modal__footer { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 16px 22px 20px; background: var(--sucre); border-top: 1.5px solid var(--cacao); }

/* Embedded content waiting for consent --------------------------------------- */
.consentpilot-embed { position: relative; width: 100%; aspect-ratio: var(--cp-embed-ratio, 16 / 9); background: var(--kraft); border: 1.5px solid var(--cacao); }
.consentpilot-embed--active { border: 0; background: none; }
.consentpilot-embed__placeholder { height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 10px; padding: clamp(18px, 4vw, 36px); }
.consentpilot-embed__icon { width: 44px; height: 44px; display: grid; place-items: center; background: var(--cacao); color: var(--farine); }
.consentpilot-embed__icon svg { width: 22px; height: 22px; }
.consentpilot-embed__service { font-family: var(--f-display); font-size: 22px; font-weight: 600; }
.consentpilot-embed__message { max-width: 520px; font-size: 14px; color: var(--cacao-doux); }

@keyframes cpz-in { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes cpz-peek { from { transform: translateY(60%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes cpz-hop { 0%, 100% { transform: none; } 40% { transform: translateY(-12px) rotate(-6deg); } 70% { transform: translateY(-2px) rotate(4deg); } }
@keyframes cpz-sulk { 0%, 100% { transform: none; } 30% { transform: translateY(30%) rotate(4deg); } 70% { transform: translateY(26%) rotate(-3deg); } }

@media (max-width: 640px) {
	.consentpilot-banner { left: 8px; right: 8px; bottom: 8px; width: auto; }
	.consentpilot-banner__inner { gap: 14px; padding: 20px 16px 12px; }
	.consentpilot-banner__inner::before { width: 84px; height: 60px; right: 12px; }
	.consentpilot-banner__title { font-size: 24px; padding-right: 0; }
	.consentpilot-banner__text { font-size: 14px; }
	.consentpilot-modal { padding: 0; align-items: end; }
	.consentpilot-modal__dialog { width: 100%; max-height: 92vh; border-left: 0; border-right: 0; border-bottom: 0; }
	.consentpilot-modal__header::after { right: 70px; width: 78px; height: 66px; }
	.consentpilot-modal__header > div { padding-right: 70px; }
	.consentpilot-modal__body { padding: 16px; }
	.consentpilot-modal__footer { padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) {
	.consentpilot-banner__actions, .consentpilot-modal__footer { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
	.consentpilot-banner, .consentpilot-banner__inner::before, .consentpilot-modal__dialog, .consentpilot-modal__category { animation: none !important; }
}
@media print { .consentpilot-banner, .consentpilot-modal { display: none !important; } }
