/* Cyfrowy Uczeń – Harmonogram programu 2.1
 * Wygląd: generator wniosków (karty, pigułki kroków, komunikaty) + oś statusów.
 * Kolory i rozmiary sterowane zmiennymi --cuh-* z kontrolek Elementora.
 */

.cuh {
	/* Marka */
	--cuh-accent: #00D871;
	--cuh-accent-status: #00B862;
	--cuh-accent-text: #0E7646;
	--cuh-dark: #0E0E0E;
	--cuh-deep: #002112;
	--cuh-muted: rgba(0, 0, 0, .58);
	--cuh-mint: #E7FCF1;
	--cuh-border: #E9EBEE;
	--cuh-grey: #EEF0F2;
	--cuh-grey-text: #9AA1AC;

	/* Przełącznik */
	--cuh-tab-gap: 8px;
	--cuh-tab-radius: 999px;
	--cuh-tab-icon: 22px;
	--cuh-tab-bg: #FFFFFF;
	--cuh-tab-color: var(--cuh-dark);
	--cuh-tab-border: var(--cuh-border);
	--cuh-tab-hover-bg: #FFFFFF;
	--cuh-tab-hover-color: var(--cuh-dark);
	--cuh-tab-hover-border: var(--cuh-accent);
	--cuh-tab-active-bg: var(--cuh-dark);
	--cuh-tab-active-color: #FFFFFF;
	--cuh-tab-active-border: var(--cuh-dark);
	--cuh-tab-done-bg: var(--cuh-mint);
	--cuh-tab-done-color: var(--cuh-deep);
	--cuh-track-bg: #F4F5F7;
	--cuh-ed-done: var(--cuh-accent);
	--cuh-ed-active: var(--cuh-accent);
	--cuh-ed-planned: var(--cuh-grey-text);

	/* Komunikaty */
	--cuh-note-radius: 14px;
	--cuh-note-info-bg: #EEF4FF;
	--cuh-note-info-border: #C9D9F5;
	--cuh-note-info-color: #284A86;
	--cuh-note-warn-bg: #FDF7E9;
	--cuh-note-warn-border: #F2DFAE;
	--cuh-note-warn-color: #744D0C;
	--cuh-note-success-bg: var(--cuh-mint);
	--cuh-note-success-border: #B9EBD2;
	--cuh-note-success-color: var(--cuh-accent-text);

	/* Oś czasu */
	--cuh-stage-gap: 28px;
	--cuh-marker-gap: 18px;
	--cuh-meta-gap: 6px;
	--cuh-current-row-bg: var(--cuh-mint);
	--cuh-line-w: 2px;
	--cuh-line-style: solid;
	--cuh-line-done: var(--cuh-accent);
	--cuh-line-pending: #E2E5EA;

	/* Znaczniki */
	--cuh-m-size: 34px;
	--cuh-m-icon: 15px;
	--cuh-m-radius: 50%;
	--cuh-m-bw: 0px;
	--cuh-pulse: color-mix(in srgb, var(--cuh-accent) 35%, transparent);
	--cuh-pulse-speed: 1.8s;

	--cuh-done-bg: var(--cuh-accent);       --cuh-done-border: var(--cuh-accent);       --cuh-done-icon: #FFFFFF;
	--cuh-current-bg: var(--cuh-accent);    --cuh-current-border: var(--cuh-accent);    --cuh-current-icon: #FFFFFF;
	--cuh-waiting-bg: var(--cuh-grey);      --cuh-waiting-border: var(--cuh-grey);      --cuh-waiting-icon: var(--cuh-grey-text);
	--cuh-no-date-bg: var(--cuh-grey);      --cuh-no-date-border: var(--cuh-grey);      --cuh-no-date-icon: var(--cuh-grey-text);
	--cuh-custom: #E8A20C;

	/* Teksty etapów */
	--cuh-done-title: #1F2A37;      --cuh-done-text: var(--cuh-accent-status);
	--cuh-current-title: var(--cuh-accent-text); --cuh-current-text: var(--cuh-accent-status);
	--cuh-waiting-title: #3B4350;   --cuh-waiting-text: var(--cuh-grey-text);
	--cuh-no-date-title: #3B4350;   --cuh-no-date-text: var(--cuh-grey-text);
	--cuh-hourglass: #E8A20C;
	--cuh-hourglass-size: 13px;

	/* Odliczanie */
	--cuh-cd-bg: #FDF1D6;
	--cuh-cd-color: #744D0C;
	--cuh-cd-border: transparent;
	--cuh-cd-radius: 999px;

	box-sizing: border-box;
	color: var(--cuh-dark);
	font-family: inherit;
}

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

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

.cuh svg {
	display: block;
	width: 1em;
	height: 1em;
}

/* ================================================================ Przełącznik */

.cuh__switcher {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 10px 14px;
	margin-bottom: 20px;
}

.cuh__switcher-label {
	font-size: 13px;
	font-weight: 600;
	color: var(--cuh-dark);
}

.cuh__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: var(--cuh-tab-gap);
	min-width: 0;
	max-width: 100%;
}

.cuh__tab {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 7px 18px 7px 7px;
	border: 1px solid var(--cuh-tab-border);
	border-radius: var(--cuh-tab-radius);
	background: var(--cuh-tab-bg);
	color: var(--cuh-tab-color);
	font: inherit;
	line-height: 1.15;
	text-align: left;
	cursor: pointer;
	white-space: nowrap;
	box-shadow: none;
	transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .15s ease;
}

.cuh--no-tab-icon .cuh__tab {
	padding-left: 18px;
}

.cuh__tab.cuh-ed--done {
	background: var(--cuh-tab-done-bg);
	border-color: var(--cuh-tab-done-bg);
	color: var(--cuh-tab-done-color);
}

.cuh__tab:hover {
	background: var(--cuh-tab-hover-bg);
	border-color: var(--cuh-tab-hover-border);
	color: var(--cuh-tab-hover-color);
}

.cuh__tab:focus-visible {
	outline: 3px solid rgba(0, 216, 113, .4);
	outline-offset: 2px;
}

.cuh__tab.is-active,
.cuh__tab.is-active:hover {
	background: var(--cuh-tab-active-bg);
	border-color: var(--cuh-tab-active-border);
	color: var(--cuh-tab-active-color);
}

.cuh__tab-icon {
	position: relative;
	flex: 0 0 var(--cuh-tab-icon);
	width: var(--cuh-tab-icon);
	height: var(--cuh-tab-icon);
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #FFFFFF;
	font-size: calc(var(--cuh-tab-icon) * .58);
}

.cuh--no-tab-icon .cuh__tab-icon {
	display: none;
}

.cuh__ti {
	display: none;
}

.cuh-ed--done .cuh__ti--done {
	display: block;
	color: var(--cuh-ed-done);
}

.cuh-ed--planned .cuh__ti--planned {
	display: block;
	color: var(--cuh-ed-planned);
}

.cuh-ed--planned .cuh__tab-icon {
	background: var(--cuh-grey);
}

.cuh-ed--active .cuh__ti--active {
	display: block;
	width: 40%;
	height: 40%;
	border-radius: 50%;
	background: var(--cuh-ed-active);
	box-shadow: 0 0 0 0 var(--cuh-pulse);
	animation: cuh-pulse-sm 1.8s cubic-bezier(.66, 0, 0, 1) infinite;
}

.cuh__tab.is-active .cuh__tab-icon {
	background: #FFFFFF;
}

.cuh__tab-text {
	display: inline-flex;
	flex-direction: column;
	gap: 2px;
}

.cuh__tab-label {
	font-size: 15px;
	font-weight: 600;
	letter-spacing: -.2px;
}

.cuh__tab-status {
	font-size: 9.5px;
	font-weight: 600;
	letter-spacing: .2px;
	text-transform: uppercase;
	opacity: .7;
}

/* Wariant: zakładki w jednym pasku */
.cuh--sw-segmented .cuh__tabs {
	padding: 5px;
	border-radius: calc(var(--cuh-tab-radius) + 6px);
	background: var(--cuh-track-bg);
	gap: 4px;
}

.cuh--sw-segmented .cuh__tab {
	border-color: transparent;
	background: transparent;
}

.cuh--sw-segmented .cuh__tab.cuh-ed--done {
	background: transparent;
	color: var(--cuh-tab-color);
}

.cuh--sw-segmented .cuh__tab:hover {
	background: #FFFFFF;
	border-color: transparent;
}

.cuh--sw-segmented .cuh__tab.is-active {
	background: var(--cuh-tab-active-bg);
	color: var(--cuh-tab-active-color);
	box-shadow: 0 4px 14px rgba(0, 33, 18, .12);
}

/* Lista rozwijana */
.cuh__select-wrap {
	position: relative;
	display: none;
	min-width: 200px;
	color: var(--cuh-dark);
}

.cuh__select {
	display: block;
	width: 100%;
	margin: 0;
	padding: 12px 44px 12px 18px;
	border: 1px solid var(--cuh-border);
	border-radius: 14px;
	background: #FFFFFF;
	color: var(--cuh-dark);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
}

.cuh__select:focus-visible {
	outline: 3px solid rgba(0, 216, 113, .4);
	outline-offset: 2px;
}

.cuh__select-wrap svg {
	position: absolute;
	top: 50%;
	right: 16px;
	transform: translateY(-50%);
	pointer-events: none;
	font-size: 16px;
}

.cuh--sw-select .cuh__select-wrap {
	display: block;
}

/* ================================================================ Karta */

.cuh__card {
	position: relative;
}

.cuh-card-yes .cuh__card {
	padding: 30px 34px;
	border: 1px solid var(--cuh-border);
	border-radius: 24px;
	background: #FFFFFF;
}

/* Sama lista bez karty: miejsce na podświetlenie bieżącego etapu,
 * żeby tło nie wychodziło poza widget. */
.cuh-hl-yes:not(.cuh-card-yes) .cuh--list .cuh__list {
	padding: 10px 14px 12px 12px;
}

/* ================================================================ Komunikat edycji */

.cuh__note {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 26px;
	padding: 12px 16px;
	border: 1px solid;
	border-radius: var(--cuh-note-radius);
	font-size: 13.5px;
	line-height: 1.5;
}

.cuh__note-icon {
	flex: 0 0 auto;
	margin-top: 2px;
	font-size: 16px;
}

.cuh__note-text a {
	color: inherit;
	font-weight: 600;
	text-decoration: underline;
}

.cuh__note--info    { background: var(--cuh-note-info-bg);    border-color: var(--cuh-note-info-border);    color: var(--cuh-note-info-color); }
.cuh__note--warn    { background: var(--cuh-note-warn-bg);    border-color: var(--cuh-note-warn-border);    color: var(--cuh-note-warn-color); }
.cuh__note--success { background: var(--cuh-note-success-bg); border-color: var(--cuh-note-success-border); color: var(--cuh-note-success-color); }

/* ================================================================ Oś czasu */

.cuh__list {
	position: relative;
	isolation: isolate;
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: var(--cuh-stage-gap);
}

.cuh__stage {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: var(--cuh-marker-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.cuh__stage::marker {
	content: none;
}

/* Linia: od środka znacznika do środka kolejnego znacznika. */
.cuh-line-yes .cuh__stage:not(:last-child)::before {
	content: "";
	position: absolute;
	z-index: 0;
	left: calc(var(--cuh-m-size) / 2);
	top: calc(var(--cuh-m-size) / 2);
	height: calc(100% + var(--cuh-stage-gap));
	transform: translateX(-50%);
	border-left: var(--cuh-line-w) var(--cuh-line-style) var(--cuh-line-pending);
}

.cuh-line-yes .cuh-st--done:not(:last-child)::before {
	border-left-color: var(--cuh-line-done);
}

/* Podświetlenie bieżącego etapu. */
.cuh-hl-yes .cuh-st--current .cuh__content {
	position: relative;
}

.cuh-hl-yes .cuh-st--current .cuh__content::before {
	content: "";
	position: absolute;
	z-index: -1;
	inset: -10px -14px -12px calc(-1 * (var(--cuh-marker-gap) + var(--cuh-m-size) + 12px));
	border-radius: 16px;
	background: var(--cuh-current-row-bg);
}

/* ---------------------------------------------------------------- Znacznik */

.cuh__marker {
	position: relative;
	z-index: 1;
	flex: 0 0 var(--cuh-m-size);
	width: var(--cuh-m-size);
	height: var(--cuh-m-size);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: var(--cuh-m-bw) solid transparent;
	border-radius: var(--cuh-m-radius);
	font-size: var(--cuh-m-icon);
	line-height: 1;
	transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.cuh-st--done    .cuh__marker { background: var(--cuh-done-bg);    border-color: var(--cuh-done-border);    color: var(--cuh-done-icon); }
.cuh-st--current .cuh__marker { background: var(--cuh-current-bg); border-color: var(--cuh-current-border); color: var(--cuh-current-icon); }
.cuh-st--waiting .cuh__marker { background: var(--cuh-waiting-bg); border-color: var(--cuh-waiting-border); color: var(--cuh-waiting-icon); }
.cuh-st--no-date .cuh__marker { background: var(--cuh-no-date-bg); border-color: var(--cuh-no-date-border); color: var(--cuh-no-date-icon); }
.cuh-st--custom  .cuh__marker { background: var(--cuh-custom);     border-color: var(--cuh-custom);         color: #FFFFFF; }

.cuh__m-icon,
.cuh__m-wait,
.cuh__m-num,
.cuh__m-dot {
	display: none;
}

.cuh__m-icon svg,
.cuh__m-icon i,
.cuh__m-wait svg,
.cuh__m-wait i {
	width: 1em;
	height: 1em;
	font-size: inherit;
	color: inherit;
	fill: currentColor;
}

.cuh__m-num {
	font-size: calc(var(--cuh-m-icon) * .9);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.cuh__m-dot {
	width: 34%;
	height: 34%;
	border-radius: 50%;
	background: currentColor;
}

.cuh-st--done .cuh__m-icon {
	display: inline-flex;
}

.cuh-st--current .cuh__m-dot,
.cuh-st--custom .cuh__m-dot {
	display: block;
}

.cuh-cur-number .cuh-st--current .cuh__m-dot {
	display: none;
}

.cuh-cur-number .cuh-st--current .cuh__m-num {
	display: inline;
}

.cuh-st--waiting .cuh__m-num,
.cuh-st--no-date .cuh__m-num {
	display: inline;
}

.cuh-wait-empty .cuh-st--waiting .cuh__m-num,
.cuh-wait-empty .cuh-st--no-date .cuh__m-num,
.cuh-wait-icon .cuh-st--waiting .cuh__m-num,
.cuh-wait-icon .cuh-st--no-date .cuh__m-num {
	display: none;
}

.cuh-wait-icon .cuh-st--waiting .cuh__m-wait,
.cuh-wait-icon .cuh-st--no-date .cuh__m-wait {
	display: inline-flex;
}

.cuh-pulse-yes .cuh-st--current .cuh__marker {
	animation: cuh-pulse var(--cuh-pulse-speed) cubic-bezier(.66, 0, 0, 1) infinite;
}

@keyframes cuh-pulse {
	0%   { box-shadow: 0 0 0 0 var(--cuh-pulse); }
	70%  { box-shadow: 0 0 0 calc(var(--cuh-m-size) * .3) rgba(0, 0, 0, 0); }
	100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}

@keyframes cuh-pulse-sm {
	0%   { box-shadow: 0 0 0 0 var(--cuh-pulse); }
	70%  { box-shadow: 0 0 0 5px rgba(0, 0, 0, 0); }
	100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}

/* ---------------------------------------------------------------- Treść */

.cuh__content {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: var(--cuh-meta-gap);
	padding-top: calc((var(--cuh-m-size) - 1.4em) / 2);
}

.cuh__stage-title {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: -.2px;
}

.cuh-st--done    .cuh__stage-title { color: var(--cuh-done-title); }
.cuh-st--current .cuh__stage-title { color: var(--cuh-current-title); }
.cuh-st--waiting .cuh__stage-title { color: var(--cuh-waiting-title); }
.cuh-st--no-date .cuh__stage-title { color: var(--cuh-no-date-title); }
.cuh-st--custom  .cuh__stage-title { color: var(--cuh-waiting-title); }

.cuh__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
}

.cuh__status {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
}

.cuh__status-text:empty {
	display: none;
}

.cuh-st--done    .cuh__status { color: var(--cuh-done-text); }
.cuh-st--current .cuh__status { color: var(--cuh-current-text); }
.cuh-st--waiting .cuh__status { color: var(--cuh-waiting-text); font-weight: 400; }
.cuh-st--no-date .cuh__status { color: var(--cuh-no-date-text); font-weight: 400; }
.cuh-st--custom  .cuh__status { color: var(--cuh-custom); }

.cuh__hourglass {
	display: none;
	color: var(--cuh-hourglass);
	font-size: var(--cuh-hourglass-size);
	line-height: 1;
}

.cuh__hourglass svg,
.cuh__hourglass i {
	width: 1em;
	height: 1em;
	font-size: inherit;
	color: inherit;
	fill: currentColor;
}

.cuh-st--no-date .cuh__hourglass {
	display: inline-flex;
}

.cuh__countdown {
	display: inline-flex;
	align-items: center;
	padding: 3px 10px;
	border: 1px solid var(--cuh-cd-border);
	border-radius: var(--cuh-cd-radius);
	background: var(--cuh-cd-bg);
	color: var(--cuh-cd-color);
	font-size: 11px;
	font-weight: 600;
	line-height: 1.4;
	white-space: nowrap;
}

.cuh__stage-desc {
	font-size: 13px;
	font-weight: 300;
	line-height: 1.55;
	color: var(--cuh-muted);
}

.cuh__stage-desc a {
	color: var(--cuh-accent-text);
	font-weight: 500;
}

.cuh__empty {
	margin: 0;
	padding: 18px 0;
	color: var(--cuh-muted);
	text-align: center;
}

/* ================================================================ Przypis */

.cuh__footer {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	gap: 8px;
	margin: 16px 0 0;
	font-size: 12px;
	font-weight: 300;
	line-height: 1.5;
	color: var(--cuh-muted);
	text-align: center;
}

.cuh__footer-icon {
	flex: 0 0 auto;
	margin-top: 2px;
	font-size: 13px;
}

/* ================================================================ Edytor */

.cuh__editor-alert {
	margin-bottom: 16px;
	padding: 10px 14px;
	border: 1px dashed #E8A20C;
	border-radius: 10px;
	background: #FDF7E9;
	color: #744D0C;
	font-size: 13px;
}

/* ================================================================ Ruch */

@media (prefers-reduced-motion: reduce) {
	.cuh-pulse-yes .cuh-st--current .cuh__marker,
	.cuh-ed--active .cuh__ti--active {
		animation: none;
	}
}

/* ================================================================ Telefon */

@media (max-width: 767px) {
	.cuh-card-yes .cuh__card {
		padding: 22px 18px;
		border-radius: 20px;
	}

	.cuh__switcher {
		flex-direction: column;
		align-items: stretch;
	}

	.cuh__switcher-label {
		text-align: center;
	}

	.cuh--m-scroll .cuh__tabs {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		padding: 4px 2px;
		scroll-snap-type: x proximity;
	}

	.cuh--m-scroll .cuh__tabs::-webkit-scrollbar {
		display: none;
	}

	.cuh--m-scroll .cuh__tab {
		scroll-snap-align: center;
		flex: 0 0 auto;
	}

	.cuh--m-wrap .cuh__tabs {
		justify-content: center;
	}

	.cuh--m-select .cuh__tabs {
		display: none;
	}

	.cuh--m-select .cuh__select-wrap {
		display: block;
	}

	.cuh-hl-yes .cuh-st--current .cuh__content::before {
		inset: -8px -10px -10px calc(-1 * (var(--cuh-marker-gap) + var(--cuh-m-size) + 8px));
	}
}
