/* Custom Loading Page – frontend loader stílusok */

#clp-overlay {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#clp-overlay * {
	box-sizing: border-box;
}

.clp-stage {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 22px;
	padding: 24px;
	text-align: center;
}

/* ---- Logó keret ---- */
.clp-logo-wrap {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--clp-logo-w, 160px);
	min-height: 48px;
}

.clp-logo {
	display: block;
	width: var(--clp-logo-w, 160px);
	height: auto;
	-webkit-user-select: none;
	user-select: none;
	-webkit-user-drag: none;
}

/* A "feltöltődés" módnál a két réteget egy pontosan logó méretű konténer fogja össze,
   hogy a körkörös mód nagyobb kerete ne torzítsa el a felső réteg igazítását. */
.clp-logo-stack {
	position: relative;
	width: var(--clp-logo-w, 160px);
	line-height: 0;
}
.clp-logo-stack .clp-logo {
	width: 100%;
}

/* ---- "Feltöltődés" effekt (signature) ---- */
/* Alsó réteg: halvány "üres" logó. Felső réteg: alulról felfelé feltáruló teljes logó. */
.clp-anim-fill .clp-logo-base {
	opacity: 0.18;
}

.clp-anim-fill .clp-logo-fill {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	opacity: 1;
	/* A JS a --clp-fill (0–100) változót állítja. 0%-nál teljesen elrejtve, 100%-nál teljes. */
	-webkit-clip-path: inset(calc(100% - var(--clp-fill, 0%)) 0 0 0);
	clip-path: inset(calc(100% - var(--clp-fill, 0%)) 0 0 0);
	transition: -webkit-clip-path 120ms linear, clip-path 120ms linear;
}

/* ---- Belépő animációk (nem-fill módokhoz) ---- */
.clp-anim-fade .clp-logo {
	animation: clp-fade-in 800ms ease both;
}
.clp-anim-slide-up .clp-stage,
.clp-anim-slide-up .clp-logo {
	animation: clp-slide-up 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.clp-anim-pulse .clp-logo {
	animation: clp-pulse 1500ms ease-in-out infinite;
}

@keyframes clp-fade-in {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}
@keyframes clp-slide-up {
	from { opacity: 0; transform: translateY(40px); }
	to   { opacity: 1; transform: translateY(0); }
}
@keyframes clp-pulse {
	0%, 100% { transform: scale(1); opacity: 0.85; }
	50%      { transform: scale(1.06); opacity: 1; }
}

/* ---- Logó nélküli tartalék jel ---- */
.clp-fallback-mark {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	border: 4px solid color-mix(in srgb, var(--clp-text) 18%, transparent);
	border-top-color: var(--clp-accent);
	animation: clp-spin 900ms linear infinite;
}
@keyframes clp-spin {
	to { transform: rotate(360deg); }
}

/* ---- Százalék: a logó alatt, középen ---- */
.clp-percent {
	display: flex;
	align-items: baseline;
	justify-content: center;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	color: var(--clp-text);
	letter-spacing: -0.02em;
	pointer-events: none;
}
.clp-percent-num { font-size: 26px; }
.clp-percent-sign { font-size: 16px; opacity: 0.7; margin-left: 1px; }

/* ---- Felirat ---- */
.clp-text {
	color: var(--clp-text);
	font-size: 14px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.72;
}

/* ---- Körkörös mutató ---- */
.clp-ring {
	position: absolute;
	left: 50%;
	top: 50%;
	width: calc(var(--clp-logo-w, 160px) + 56px);
	height: calc(var(--clp-logo-w, 160px) + 56px);
	transform: translate(-50%, -50%) rotate(-90deg);
	pointer-events: none;
}
.clp-ring-track {
	fill: none;
	stroke: color-mix(in srgb, var(--clp-text) 14%, transparent);
	stroke-width: 4;
}
.clp-ring-fill {
	fill: none;
	stroke: var(--clp-accent);
	stroke-width: 4;
	stroke-linecap: round;
	stroke-dasharray: 339.292;
	stroke-dashoffset: 339.292; /* JS állítja */
	transition: stroke-dashoffset 120ms linear;
}
/* A körkörös módban a logót a gyűrű alatti rétegre tesszük, és a wrap-et úgy igazítjuk,
   hogy a gyűrű a logó köré simuljon. */
#clp-overlay[data-progress="circular"] .clp-logo-wrap {
	min-height: calc(var(--clp-logo-w, 160px) + 56px);
}

/* ---- Vízszintes sáv ---- */
.clp-bar {
	width: min(260px, 60vw);
	height: 4px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--clp-text) 14%, transparent);
	overflow: hidden;
}
.clp-bar-fill {
	display: block;
	height: 100%;
	width: 0%;
	border-radius: 999px;
	background: var(--clp-accent);
	transition: width 120ms linear;
}

/* ---- Mozgáscsökkentés ---- */
@media (prefers-reduced-motion: reduce) {
	.clp-anim-pulse .clp-logo,
	.clp-fallback-mark {
		animation: none;
	}
	.clp-anim-fade .clp-logo,
	.clp-anim-slide-up .clp-stage,
	.clp-anim-slide-up .clp-logo {
		animation-duration: 1ms;
	}
}

/* color-mix tartalék régebbi böngészőkre */
@supports not (color: color-mix(in srgb, white 10%, transparent)) {
	.clp-ring-track,
	.clp-bar { stroke: rgba(255, 255, 255, 0.15); background: rgba(255, 255, 255, 0.15); }
}
