/*
 * Widget Accesibilitate – interfața (încărcată în Shadow DOM).
 * Culori implicite: bleumarin #051a53 și roșu #d82221 (primariascheia.ro).
 */

:host {
	all: initial;
}

.wacc {
	--p: #051a53;
	--a: #d82221;
	--bg: #f3f4f7;
	--line: #e1e5ee;
	--muted: #59617d;
	--soft: #c9d0e4;
	--font: Manrope, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
	--size: 52px;
	--ox: 16px;
	--oy: 16px;
	--oxm: 12px;
	--oym: 84px;
	color: var(--p);
	direction: ltr;
	font-family: var(--font);
	font-size: 15px;
	font-style: normal;
	font-weight: 400;
	letter-spacing: normal;
	line-height: 1.45;
	text-align: left;
	text-indent: 0;
	text-transform: none;
	white-space: normal;
	word-spacing: normal;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.wacc *,
.wacc *::before,
.wacc *::after {
	box-sizing: border-box;
}

.wacc [hidden] {
	display: none !important;
}

/* Resetări cu specificitate mică (:where), ca regulile de mai jos să câștige. */
.wacc :where(button) {
	margin: 0;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	-webkit-tap-highlight-color: transparent;
}

.wacc :where(svg) {
	display: block;
	flex: none;
}

.wacc :where(h2, h3, p, ul) {
	margin: 0;
}

.sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	border: 0;
	white-space: nowrap;
}

/* Butonul de accesibilitate ---------------------------------------------- */
.trigger {
	position: fixed;
	z-index: 2147483646;
	display: grid;
	place-items: center;
	width: var(--size);
	height: var(--size);
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--a);
	box-shadow: 0 0 0 3px #fff, 0 10px 26px rgba(5, 26, 83, .35);
	color: #fff;
	cursor: pointer;
	transition: background-color .2s ease, scale .2s ease;
}

.trigger svg {
	width: 62%;
	height: 62%;
}

.trigger:hover {
	background: var(--p);
	scale: 1.06;
}

.trigger:focus-visible {
	outline: 3px solid var(--p);
	outline-offset: 5px;
}

.wacc[data-shape="rounded"] .trigger {
	border-radius: 12px;
}

.wacc[data-shape="square"] .trigger {
	border-radius: 0;
}

.badge {
	position: absolute;
	top: -4px;
	right: -4px;
	display: grid;
	place-items: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 0 0 2px var(--p);
	color: var(--p);
}

.badge svg {
	width: 12px;
	height: 12px;
	stroke-width: 3.5;
}

.wacc.is-open .trigger,
.wacc.is-hidden .trigger,
.wacc.is-hidden .panel {
	display: none;
}

/* Panoul ---------------------------------------------------------------- */
.panel {
	position: fixed;
	z-index: 2147483647;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--bg);
	box-shadow: 0 30px 70px rgba(5, 26, 83, .35), 0 0 0 1px rgba(5, 26, 83, .1);
	opacity: 0;
	translate: 0 10px;
	transition: opacity .2s ease, translate .2s ease;
}

.panel.in {
	opacity: 1;
	translate: none;
}

/* Panoul și fereastra primesc focus la clic pe o zonă goală (pentru Escape și Tab). */
.panel:focus,
.dialog:focus {
	outline: none;
}

.head {
	position: relative;
	display: flex;
	flex: none;
	align-items: center;
	gap: 10px;
	padding: 14px 10px 14px 16px;
	border-top: 4px solid var(--a);
	background: var(--p);
	color: #fff;
}

.head-main,
.head-page {
	display: flex;
	flex: 1;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.head-page {
	gap: 6px;
}

.head-logo {
	display: grid;
	flex: none;
	place-items: center;
	width: 44px;
	height: 44px;
	background: var(--a);
	color: #fff;
}

.head-logo svg {
	width: 28px;
	height: 28px;
}

.head-text {
	min-width: 0;
}

/* Numele lungi trec pe al doilea rând, nu se taie. */
.kicker {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin-bottom: 3px;
	color: var(--soft);
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 1px;
	line-height: 1.3;
	text-transform: uppercase;
}

.kicker::before {
	content: "";
	flex: none;
	width: 22px;
	height: 2px;
	margin-top: 6px;
	background: var(--a);
}

.kicker span {
	min-width: 0;
	overflow-wrap: break-word;
}

.title {
	color: #fff;
	font-size: 21px;
	font-weight: 800;
	letter-spacing: -.2px;
	line-height: 1.15;
}

.head-page .title {
	font-size: 19px;
}

.head-actions {
	display: flex;
	flex: none;
	gap: 2px;
}

.hbtn {
	position: relative;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #fff;
	cursor: pointer;
	transition: background-color .15s ease;
}

.hbtn svg {
	width: 20px;
	height: 20px;
}

.hbtn:hover {
	background: rgba(255, 255, 255, .14);
}

.hbtn.close:hover {
	background: var(--a);
}

.hbtn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: -4px;
}

/* Etichete la trecerea cu mouse-ul peste iconițele din antet */
[data-tip]::after {
	content: attr(data-tip);
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	z-index: 3;
	padding: 6px 9px;
	background: #0b1433;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	translate: 0 -3px;
	transition: opacity .15s ease, translate .15s ease;
}

.head-page [data-tip]::after {
	right: auto;
	left: 0;
}

[data-tip]:hover::after,
[data-tip]:focus-visible::after {
	opacity: 1;
	translate: none;
}

.body {
	flex: 1 1 auto;
	min-height: 0;
	padding: 12px;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-color: #c3c9da transparent;
	scrollbar-width: thin;
}

/* Grupe și instrumente ----------------------------------------------------- */
.group {
	padding: 14px 14px 16px;
	border: 1px solid var(--line);
	background: #fff;
}

.group + .group {
	margin-top: 12px;
}

.group-title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
	color: var(--a);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 1.4px;
	line-height: 1.2;
	text-transform: uppercase;
}

.group-title::before {
	content: "";
	width: 26px;
	height: 2px;
	background: var(--a);
}

.tools {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

.tool {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 66px;
	padding: 14px 22px 14px 12px;
	border: 1px solid var(--line);
	background: #fff;
	color: var(--p);
	cursor: pointer;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.25;
	text-align: left;
	text-decoration: none;
	transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease, color .15s ease;
}

.tool .ic {
	display: grid;
	flex: none;
	place-items: center;
	width: 38px;
	height: 38px;
	background: var(--bg);
	color: var(--p);
	transition: background-color .15s ease, color .15s ease;
}

.tool .ic svg {
	width: 22px;
	height: 22px;
}

.tool .lbl {
	flex: 1;
	min-width: 0;
	overflow-wrap: break-word;
}

.tool:hover {
	border-color: var(--p);
	box-shadow: 0 8px 18px rgba(5, 26, 83, .1);
}

.tool:hover .ic {
	background: var(--p);
	color: #fff;
}

.tool:focus-visible {
	outline: 3px solid var(--a);
	outline-offset: 2px;
}

.tool[aria-pressed="true"] {
	border-color: var(--p);
	background: var(--p);
	color: #fff;
}

.tool[aria-pressed="true"] .ic {
	background: var(--a);
	color: #fff;
}

.steps {
	position: absolute;
	right: 12px;
	bottom: 7px;
	left: 12px;
	display: flex;
	gap: 4px;
}

.steps i {
	flex: 1;
	height: 3px;
	background: var(--line);
}

.tool[aria-pressed="true"] .steps i {
	background: rgba(255, 255, 255, .22);
}

.tool[aria-pressed="true"] .steps i.on {
	background: var(--a);
}

.tick {
	position: absolute;
	top: 6px;
	right: 6px;
	display: none;
	place-items: center;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	color: var(--p);
}

.tick svg {
	width: 11px;
	height: 11px;
	stroke-width: 3.5;
}

.tool[aria-pressed="true"] .tick {
	display: grid;
}

.go {
	position: absolute;
	top: 50%;
	right: 6px;
	color: var(--muted);
	translate: 0 -50%;
}

.go svg {
	width: 15px;
	height: 15px;
}

.tool:hover .go {
	color: var(--a);
}

/* Structura paginii ---------------------------------------------------- */
.intro {
	margin-bottom: 12px;
	color: var(--muted);
	font-size: 13.5px;
}

.hlist {
	display: grid;
	gap: 6px;
	padding: 0;
	list-style: none;
}

.hitem {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	width: calc(100% - var(--lvl, 0) * 14px);
	margin-left: calc(var(--lvl, 0) * 14px);
	padding: 10px 12px;
	border: 1px solid var(--line);
	background: #fff;
	color: var(--p);
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	text-align: left;
}

.hitem:hover {
	border-color: var(--p);
}

.hitem:focus-visible {
	outline: 3px solid var(--a);
	outline-offset: 2px;
}

.hbadge {
	flex: none;
	min-width: 30px;
	padding: 3px 0;
	background: var(--p);
	color: #fff;
	font-size: 11.5px;
	font-weight: 800;
	line-height: 1.2;
	text-align: center;
}

.hitem[data-l="1"] .hbadge {
	background: var(--a);
}

.htext {
	min-width: 0;
	overflow-wrap: break-word;
}

.empty {
	padding: 24px 12px;
	border: 1px dashed #c3c9da;
	background: #fff;
	color: var(--muted);
	text-align: center;
}

/* Subsol ------------------------------------------------------------------ */
.foot {
	display: flex;
	flex: none;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 6px 14px;
	padding: 12px 16px;
	background: var(--p);
	color: var(--soft);
	font-size: 12.5px;
	line-height: 1.4;
}

.foot-actions {
	display: none;
	gap: 8px;
	width: 100%;
	margin-bottom: 4px;
}

.fbtn {
	display: inline-flex;
	flex: 1;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 12px;
	border: 1px solid rgba(255, 255, 255, .35);
	background: transparent;
	color: #fff;
	cursor: pointer;
	font-size: 13px;
	font-weight: 800;
	letter-spacing: .6px;
	text-transform: uppercase;
}

.fbtn svg {
	width: 17px;
	height: 17px;
}

.fbtn:hover {
	background: rgba(255, 255, 255, .12);
}

.fbtn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.statement {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #fff;
	font-weight: 700;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.statement svg {
	width: 14px;
	height: 14px;
}

.statement:hover {
	text-decoration-color: var(--a);
}

.statement:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.panel.in-structure .head-actions [data-act="hide"],
.panel.in-structure .head-actions [data-act="reset"],
.panel.in-structure .foot-actions {
	display: none;
}

/* Fereastra „Ascunde widgetul” ------------------------------------------------ */
.overlay {
	position: fixed;
	inset: 0;
	z-index: 2147483647;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	overflow-y: auto;
	background: rgba(5, 26, 83, .6);
}

.dialog {
	width: 100%;
	max-width: 440px;
	margin: auto;
	border-top: 4px solid var(--a);
	background: #fff;
	box-shadow: 0 30px 70px rgba(0, 0, 0, .35);
	color: var(--p);
}

.dialog-head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 18px 20px 6px;
}

.dialog-head .ic {
	display: grid;
	flex: none;
	place-items: center;
	width: 40px;
	height: 40px;
	background: var(--bg);
}

.dialog-head svg {
	width: 22px;
	height: 22px;
}

.dialog h2 {
	font-size: 17px;
	font-weight: 800;
	line-height: 1.3;
}

.opts {
	margin: 0;
	padding: 6px 20px 8px;
	border: 0;
}

.opt {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 8px;
	padding: 11px 12px;
	border: 1px solid var(--line);
	cursor: pointer;
	font-size: 14.5px;
	font-weight: 600;
}

.opt:hover,
.opt:has(input:checked) {
	border-color: var(--p);
}

.opt:has(input:checked) {
	background: #f7f8fb;
}

.opt input {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--a);
}

.opt input:focus-visible {
	outline: 3px solid var(--a);
	outline-offset: 2px;
}

.dialog-note {
	padding: 4px 20px 16px;
	color: var(--muted);
	font-size: 13px;
}

.dialog-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 10px;
	padding: 14px 20px;
	background: var(--bg);
}

.btn {
	padding: 11px 18px;
	border: 2px solid var(--p);
	background: transparent;
	color: var(--p);
	cursor: pointer;
	font-size: 13px;
	font-weight: 800;
	letter-spacing: .6px;
	text-transform: uppercase;
}

.btn:hover {
	background: var(--p);
	color: #fff;
}

.btn-primary {
	border-color: var(--a);
	background: var(--a);
	color: #fff;
}

.btn-primary:hover {
	border-color: var(--p);
	background: var(--p);
}

.btn:focus-visible {
	outline: 3px solid var(--a);
	outline-offset: 2px;
}

.btn-primary:focus-visible {
	outline-color: var(--p);
}

/* Masca de citire ------------------------------------------------------- */
.mask {
	position: fixed;
	top: 0;
	right: 0;
	left: 0;
	z-index: 2147483645;
	height: 100vh;
	background: rgba(3, 12, 38, .6);
	pointer-events: none;
	will-change: transform;
}

.mask-top {
	border-bottom: 4px solid var(--a);
	transform: translate3d(0, -100%, 0);
}

.mask-bottom {
	border-top: 4px solid var(--a);
	transform: translate3d(0, 100vh, 0);
}

/* Calculator ------------------------------------------------------------- */
@media (min-width: 768px) {
	.wacc[data-pd$="left"] .trigger { left: var(--ox); }
	.wacc[data-pd$="right"] .trigger { right: var(--ox); }
	.wacc[data-pd^="top"] .trigger { top: var(--oy); }
	.wacc[data-pd^="bottom"] .trigger { bottom: var(--oy); }
	.wacc[data-pd^="center"] .trigger { top: 0; bottom: 0; margin: auto 0; }
	.wacc[data-hide-d] .trigger { display: none; }

	.panel {
		width: 440px;
		max-width: calc(100vw - 32px);
		height: fit-content;
		max-height: calc(100vh - 32px);
	}

	.wacc[data-pd$="left"] .panel { left: 16px; }
	.wacc[data-pd$="right"] .panel { right: 16px; }
	.wacc[data-pd^="top"] .panel { top: 16px; }
	.wacc[data-pd^="bottom"] .panel { bottom: 16px; }
	.wacc[data-pd^="center"] .panel { top: 16px; bottom: 16px; margin: auto 0; }
}

/* Telefon ---------------------------------------------------------------- */
@media (max-width: 767px) {
	.wacc[data-pm$="left"] .trigger { left: var(--oxm); }
	.wacc[data-pm$="right"] .trigger { right: var(--oxm); }
	.wacc[data-pm^="top"] .trigger { top: var(--oym); }
	.wacc[data-pm^="bottom"] .trigger { bottom: var(--oym); }
	.wacc[data-pm^="center"] .trigger { top: 0; bottom: 0; margin: auto 0; }
	.wacc[data-hide-m] .trigger { display: none; }

	.panel {
		right: 0;
		bottom: 0;
		left: 0;
		width: 100%;
		max-height: 88vh;
		max-height: 88dvh;
		translate: 0 24px;
	}

	.head-actions [data-act="hide"],
	.head-actions [data-act="reset"] {
		display: none;
	}

	.foot-actions {
		display: flex;
	}

	.head {
		padding: 12px 8px 12px 14px;
	}

	.head-logo {
		width: 40px;
		height: 40px;
	}

	.title {
		font-size: 19px;
	}

	.body {
		padding: 10px;
	}

	.group {
		padding: 12px 10px 14px;
	}

	.tools {
		gap: 8px;
	}

	/* Pe ecran îngust: iconița deasupra textului */
	.tool {
		flex-direction: column;
		justify-content: center;
		gap: 8px;
		min-height: 92px;
		padding: 14px 8px 18px;
		font-size: 13.5px;
		text-align: center;
	}

	.tool .lbl {
		flex: none;
	}

	.go {
		top: 8px;
		translate: none;
	}

	.dialog-actions .btn {
		flex: 1 1 auto;
	}
}

/* Fără animații când vizitatorul le-a oprit ------------------------------- */
.wacc.no-motion .panel,
.wacc.no-motion .trigger,
.wacc.no-motion [data-tip]::after {
	transition: none;
}

@media (prefers-reduced-motion: reduce) {
	.panel,
	.trigger,
	[data-tip]::after {
		transition: none;
	}
}
