/**
 * Atanasov Cookie Consent — premium UI.
 * Matches atanasov.cloud: Sofia Sans, violet #7B61FF gradient, pill buttons.
 * Colours are overridable via CSS variables set inline by the plugin.
 */

#acc-root {
	--acc-primary: #7B61FF;
	--acc-primary-2: #642EDA;
	--acc-accent: #3B82F6;
	--acc-radius: 20px;
	--acc-radius-btn: 9999px;
	--acc-font: "Sofia Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

	/* light theme */
	--acc-bg: #ffffff;
	--acc-surface: #f9fafb;
	--acc-text: #1f2430;
	--acc-muted: #5b6472;
	--acc-border: rgba(17, 17, 26, 0.08);
	--acc-shadow: 0 24px 60px -12px rgba(19, 19, 26, 0.28), 0 8px 24px -8px rgba(100, 46, 218, 0.18);
	--acc-track: #e5e7eb;
}

#acc-root .acc-theme-dark,
#acc-root.acc-theme-dark {
	--acc-bg: #13131a;
	--acc-surface: #1c1c26;
	--acc-text: #f4f4f7;
	--acc-muted: #a7abba;
	--acc-border: rgba(255, 255, 255, 0.10);
	--acc-shadow: 0 24px 70px -12px rgba(0, 0, 0, 0.65), 0 8px 24px -8px rgba(123, 97, 255, 0.35);
	--acc-track: #35354a;
}

#acc-root *,
#acc-root *::before,
#acc-root *::after { box-sizing: border-box; }

/* ------------------------------------------------------------------ banner */

.acc-banner {
	position: fixed;
	z-index: 2147483000;
	font-family: var(--acc-font);
	color: var(--acc-text);
	background: var(--acc-bg);
	border: 1px solid var(--acc-border);
	border-radius: var(--acc-radius);
	box-shadow: var(--acc-shadow);
	opacity: 0;
	transform: translateY(24px);
	transition: opacity .45s cubic-bezier(.16,1,.3,1), transform .45s cubic-bezier(.16,1,.3,1);
	will-change: transform, opacity;
	overflow: hidden;
}
.acc-banner.acc-in { opacity: 1; transform: translateY(0); }

/* gradient hairline on top */
.acc-banner::before {
	content: "";
	position: absolute; inset: 0 0 auto 0; height: 3px;
	background: linear-gradient(90deg, var(--acc-primary), var(--acc-accent), var(--acc-primary-2));
}

.acc-pos-bottom { left: 24px; right: 24px; bottom: 24px; max-width: 1080px; margin: 0 auto; }
.acc-pos-bottom-left { left: 24px; bottom: 24px; max-width: 460px; }
.acc-pos-bottom-right { right: 24px; bottom: 24px; max-width: 460px; }
.acc-pos-center {
	left: 50%; top: 50%; transform: translate(-50%, -46%) scale(.98);
	max-width: 560px; width: calc(100% - 40px);
}
.acc-pos-center.acc-in { transform: translate(-50%, -50%) scale(1); }

.acc-banner-inner {
	display: flex;
	align-items: flex-start;
	gap: 18px;
	padding: 26px 28px;
}
.acc-pos-bottom-left .acc-banner-inner,
.acc-pos-bottom-right .acc-banner-inner,
.acc-pos-center .acc-banner-inner { flex-direction: column; gap: 14px; }

.acc-badge {
	flex: 0 0 auto;
	width: 46px; height: 46px;
	display: grid; place-items: center;
	font-size: 22px; line-height: 1;
	border-radius: 14px;
	background: linear-gradient(135deg, rgba(123,97,255,.14), rgba(59,130,246,.14));
	border: 1px solid var(--acc-border);
}

.acc-content { flex: 1 1 auto; min-width: 0; }
.acc-title {
	margin: 0 0 6px;
	font-size: 19px; font-weight: 800; letter-spacing: -.01em;
	color: var(--acc-text); line-height: 1.2;
}
.acc-body {
	margin: 0;
	font-size: 14px; line-height: 1.6; font-weight: 400;
	color: var(--acc-muted);
}
.acc-link, .acc-inline-link {
	color: var(--acc-primary); text-decoration: none; font-weight: 600;
	border-bottom: 1px solid transparent; transition: border-color .2s;
}
.acc-link:hover, .acc-inline-link:hover { border-bottom-color: currentColor; }

/* ------------------------------------------------------------------ actions */

.acc-actions {
	flex: 0 0 auto;
	display: flex; align-items: center; gap: 10px;
	flex-wrap: wrap;
}
.acc-pos-bottom-left .acc-actions,
.acc-pos-bottom-right .acc-actions,
.acc-pos-center .acc-actions { width: 100%; }

.acc-btn {
	font-family: var(--acc-font);
	font-size: 14px; font-weight: 600;
	padding: 12px 22px;
	border-radius: var(--acc-radius-btn);
	border: 1px solid transparent;
	cursor: pointer;
	line-height: 1;
	white-space: nowrap;
	transition: transform .18s ease, box-shadow .25s ease, background .25s ease, border-color .2s ease, color .2s ease;
}
.acc-btn:focus-visible { outline: 3px solid rgba(123,97,255,.45); outline-offset: 2px; }
.acc-btn:active { transform: translateY(1px); }

.acc-btn-primary {
	color: #fff;
	background: linear-gradient(135deg, var(--acc-primary), var(--acc-primary-2));
	box-shadow: 0 8px 20px -6px rgba(100,46,218,.55);
}
.acc-btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 14px 30px -8px rgba(100,46,218,.65);
}

.acc-btn-ghost {
	color: var(--acc-text);
	background: var(--acc-surface);
	border-color: var(--acc-border);
}
.acc-btn-ghost:hover { border-color: var(--acc-primary); color: var(--acc-primary); }

/* ------------------------------------------------------------------ modal */

.acc-overlay {
	position: fixed; inset: 0; z-index: 2147483001;
	display: grid; place-items: center;
	padding: 20px;
	background: rgba(13, 12, 21, 0.55);
	backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
	opacity: 0; transition: opacity .3s ease;
	font-family: var(--acc-font);
}
.acc-overlay.acc-in { opacity: 1; }

.acc-modal {
	width: 100%; max-width: 620px; max-height: 88vh;
	display: flex; flex-direction: column;
	background: var(--acc-bg); color: var(--acc-text);
	border: 1px solid var(--acc-border);
	border-radius: var(--acc-radius);
	box-shadow: var(--acc-shadow);
	transform: translateY(16px) scale(.98);
	transition: transform .35s cubic-bezier(.16,1,.3,1);
	overflow: hidden;
}
.acc-overlay.acc-in .acc-modal { transform: translateY(0) scale(1); }
.acc-modal::before {
	content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
	background: linear-gradient(90deg, var(--acc-primary), var(--acc-accent), var(--acc-primary-2));
}

.acc-modal-head {
	display: flex; align-items: center; justify-content: space-between;
	padding: 24px 26px 8px;
}
.acc-modal .acc-body { padding: 0 26px; }
.acc-close {
	background: transparent; border: 0; cursor: pointer;
	font-size: 28px; line-height: 1; color: var(--acc-muted);
	width: 36px; height: 36px; border-radius: 10px;
	transition: background .2s, color .2s;
}
.acc-close:hover { background: var(--acc-surface); color: var(--acc-text); }

.acc-cats {
	padding: 16px 26px 4px;
	overflow-y: auto;
	display: flex; flex-direction: column; gap: 12px;
}
.acc-cat {
	background: var(--acc-surface);
	border: 1px solid var(--acc-border);
	border-radius: 14px;
	padding: 16px 18px;
}
.acc-cat-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.acc-cat-title { font-size: 15px; font-weight: 700; }
.acc-cat-desc { margin: 8px 0 0; font-size: 13px; line-height: 1.55; color: var(--acc-muted); }
.acc-always { font-size: 12px; font-weight: 700; color: var(--acc-primary); white-space: nowrap; }

/* toggle switch */
.acc-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
.acc-switch input { opacity: 0; width: 0; height: 0; }
.acc-slider {
	position: absolute; inset: 0; cursor: pointer;
	background: var(--acc-track); border-radius: 9999px; transition: background .25s;
}
.acc-slider::before {
	content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px;
	background: #fff; border-radius: 50%; transition: transform .25s cubic-bezier(.16,1,.3,1);
	box-shadow: 0 2px 5px rgba(0,0,0,.25);
}
.acc-switch input:checked + .acc-slider { background: linear-gradient(135deg, var(--acc-primary), var(--acc-primary-2)); }
.acc-switch input:checked + .acc-slider::before { transform: translateX(20px); }
.acc-switch input:focus-visible + .acc-slider { outline: 3px solid rgba(123,97,255,.45); outline-offset: 2px; }

.acc-modal-foot {
	display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
	padding: 18px 26px 24px;
	border-top: 1px solid var(--acc-border);
	margin-top: 8px;
}

/* ------------------------------------------------------------ floating btn */

.acc-float {
	position: fixed; left: 20px; bottom: 20px; z-index: 2147482000;
	width: 50px; height: 50px; border-radius: 50%;
	border: 1px solid var(--acc-border);
	background: var(--acc-bg);
	font-size: 22px; cursor: pointer;
	box-shadow: 0 10px 26px -8px rgba(19,19,26,.4);
	opacity: 0; transform: scale(.6) translateY(10px);
	transition: opacity .35s ease, transform .35s cubic-bezier(.16,1,.3,1), box-shadow .25s;
	display: grid; place-items: center;
}
.acc-float.acc-in { opacity: .9; transform: scale(1) translateY(0); }
.acc-float:hover { opacity: 1; transform: scale(1.08); box-shadow: 0 14px 30px -8px rgba(100,46,218,.5); }

/* --------------------------------------------------------- policy table */

.acc-policy-table {
	width: 100%; border-collapse: collapse; font-family: var(--acc-font, sans-serif);
	margin: 16px 0; font-size: 14px;
}
.acc-policy-table th, .acc-policy-table td {
	text-align: left; padding: 12px 14px; border: 1px solid rgba(17,17,26,.1); vertical-align: top;
}
.acc-policy-table thead th { background: #f9fafb; font-weight: 700; }

/* ------------------------------------------------------------- responsive */

@media (max-width: 720px) {
	.acc-pos-bottom { left: 12px; right: 12px; bottom: 12px; }
	.acc-banner-inner { flex-direction: column; gap: 14px; padding: 22px; }
	.acc-actions { width: 100%; }
	.acc-actions .acc-btn { flex: 1 1 auto; text-align: center; }
	.acc-modal-foot .acc-btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
	.acc-banner, .acc-overlay, .acc-modal, .acc-float, .acc-btn, .acc-slider::before { transition: none !important; }
}
