/**
 * Plusko widget styles.
 *
 * Scoped to #plusko-widget. Loaded on every front-end page (the trigger needs it);
 * the widget script itself loads only on click. Motion is limited to a 180 ms fade-in
 * of the panel, 150 ms colour changes and one 400 ms move of the mascot from the hero
 * position to the corner, all off under prefers-reduced-motion.
 */

#plusko-widget {
	--plusko-brand: #bb2548;
	--plusko-brand-dark: #9c1e3c;
	--plusko-text: #404040;
	--plusko-border: #e2e2e2;
	--plusko-muted: #f5f5f5;
	color: var(--plusko-text);
	font-family: inherit;
}

#plusko-widget [hidden] {
	display: none !important;
}

#plusko-widget *,
#plusko-widget *::before,
#plusko-widget *::after {
	box-sizing: border-box;
}

/* Reset theme styles that commonly leak into buttons, inputs and text. */
#plusko-widget button,
#plusko-widget input,
#plusko-widget textarea {
	margin: 0;
	font: inherit;
	letter-spacing: normal;
	text-transform: none;
	min-height: 0;
	box-shadow: none;
}

#plusko-widget p {
	margin: 0;
}

/* Trigger: full-body mascot standing bottom-right (transparent PNG, no frame). */

#plusko-widget .plusko-trigger {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 99990;
	display: block;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	line-height: 1;
}

#plusko-widget .plusko-trigger:focus-visible {
	outline: 3px solid var(--plusko-brand);
	outline-offset: 3px;
}

/* drop-shadow follows the figure's outline; box-shadow would draw a rectangle. */
#plusko-widget .plusko-trigger__icon {
	display: block;
	width: auto;
	height: 96px;
	max-width: none;
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

#plusko-widget .plusko-trigger:hover .plusko-trigger__icon {
	filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.5));
}

#plusko-widget .plusko-trigger__fallback {
	display: block;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	background: var(--plusko-brand);
	color: #fff;
	font: 700 24px/56px Arial, Helvetica, sans-serif;
	text-align: center;
}

/* Teaser: speech bubble left of the mascot's head, shown once per session by the loader. */

#plusko-widget .plusko-teaser {
	position: fixed;
	right: 76px; /* trigger 24 + mascot 54, minus 2 so the tail reaches the figure */
	bottom: 72px; /* tail at mouth height, about 88px */
	z-index: 99990;
	width: max-content;
	max-width: 280px;
	padding: 10px 32px 10px 14px;
	border: 1px solid var(--plusko-border);
	border-radius: 8px;
	background: #fff;
	filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.15)); /* includes the tail, unlike box-shadow */
	font-size: 14px;
	line-height: 1.4;
	text-align: left;
}

/* Tail: a rotated square whose top-right corner points at the mascot. */
#plusko-widget .plusko-teaser::after {
	content: "";
	position: absolute;
	right: -6px;
	bottom: 11px;
	width: 10px;
	height: 10px;
	border-top: 1px solid var(--plusko-border);
	border-right: 1px solid var(--plusko-border);
	background: #fff;
	transform: rotate(45deg);
}

/* Hero position (class printed by PHP, removed by the loader): 1.4 times larger, right
   side, centre at 45% of the window height, scrolling with the page until its top
   reaches the top of the window. Desktop only. Asked by the client 2026-10-22. The
   bubble stays at the mascot's mouth. */
#plusko-widget .plusko-trigger {
	transform-origin: 100% 50%;
	transition: transform 400ms ease;
}

#plusko-widget .plusko-teaser {
	transition: transform 400ms ease;
}

@media (min-width: 601px) {
	#plusko-widget.plusko--hero .plusko-trigger {
		position: absolute;
		top: calc(45vh - 48px); /* centre of the 96px figure */
		bottom: auto;
		transform: scale(1.4);
	}

	/* Tail at the mouth: 16px above the centre at normal size, 22px when scaled; mascot 22px wider. */
	#plusko-widget.plusko--hero .plusko-teaser {
		position: absolute;
		top: calc(45vh - 6px);
		bottom: auto;
		transform: translate(-22px, -100%);
	}
}

#plusko-widget .plusko-teaser__text {
	cursor: pointer;
	white-space: pre-line;
}

#plusko-widget .plusko-teaser__close {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: #6b6b6b;
	font-size: 18px;
	line-height: 24px;
	cursor: pointer;
}

#plusko-widget .plusko-teaser__close:hover,
#plusko-widget .plusko-teaser__close:focus-visible {
	background: var(--plusko-muted);
	color: var(--plusko-text);
}

#plusko-widget .plusko-teaser__close:focus-visible {
	outline: 2px solid var(--plusko-brand);
	outline-offset: 1px;
}

/* Panel. */

#plusko-widget .plusko-panel {
	position: fixed;
	right: 24px;
	bottom: 132px; /* trigger 24 + 96 + 12 gap */
	z-index: 99991;
	display: flex;
	flex-direction: column;
	width: 380px;
	max-width: calc(100vw - 32px);
	max-height: min(620px, calc(100vh - 156px));
	overflow: hidden;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), 0 18px 44px rgba(0, 0, 0, 0.16);
	font-size: 15px;
	line-height: 1.5;
	text-align: left;
	animation: plusko-in 180ms ease-out; /* replays on every open: the panel leaves display:none */
}

@keyframes plusko-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

#plusko-widget .plusko-panel button,
#plusko-widget .plusko-panel input,
#plusko-widget .plusko-panel textarea {
	transition: background-color 150ms, border-color 150ms, color 150ms, box-shadow 150ms;
}

@media (prefers-reduced-motion: reduce) {
	#plusko-widget .plusko-panel {
		animation: none;
	}

	#plusko-widget .plusko-panel button,
	#plusko-widget .plusko-panel input,
	#plusko-widget .plusko-panel textarea,
	#plusko-widget .plusko-trigger,
	#plusko-widget .plusko-teaser {
		transition: none;
	}
}

#plusko-widget .plusko-header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 14px 16px 18px;
	background: var(--plusko-brand);
	color: #fff;
}

#plusko-widget .plusko-avatar {
	position: relative;
	flex: none;
	width: 44px;
	height: 44px;
	overflow: hidden;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

/* Head of the full-body mascot (head box about x 33-122, y 0-118 of 160x288). Recheck if the art changes. */
#plusko-widget .plusko-avatar img {
	position: absolute;
	top: 3px;
	left: -3px;
	width: 52px;
	max-width: none;
	height: auto;
}

#plusko-widget .plusko-header__text {
	flex: 1 1 auto;
	min-width: 0;
}

#plusko-widget .plusko-title {
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	text-transform: uppercase; /* in CSS, not the string: screen readers keep reading "Plusko" as a word */
}

#plusko-widget .plusko-subtitle {
	font-size: 13px;
	line-height: 1.35;
	color: rgba(255, 255, 255, 0.88);
}

#plusko-widget .plusko-close {
	flex: none;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	font-size: 22px;
	line-height: 32px;
	cursor: pointer;
}

#plusko-widget .plusko-close:hover,
#plusko-widget .plusko-close:focus-visible {
	background: rgba(255, 255, 255, 0.16);
}

#plusko-widget .plusko-close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 1px;
}

#plusko-widget .plusko-body {
	position: relative;
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 20px 18px;
}

#plusko-widget .plusko-intro,
#plusko-widget .plusko-status {
	margin-bottom: 18px;
}

#plusko-widget .plusko-status {
	color: #6b6b6b;
}

#plusko-widget .plusko-intro {
	white-space: pre-line;
	margin-bottom: 1.5em; /* same gap as the blank line between its paragraphs */
}

#plusko-widget .plusko-intro-note {
	margin-bottom: 18px;
	font-size: 13px;
	line-height: 1.4;
	font-style: italic;
}

/* Quick questions. */

#plusko-widget .plusko-quick {
	margin-bottom: 8px;
}

#plusko-widget .plusko-quick__heading {
	margin-bottom: 10px;
	font-size: 13px;
	font-weight: 700;
	color: var(--plusko-text);
}

#plusko-widget .plusko-quick__button {
	display: block;
	width: 100%;
	margin-bottom: 8px;
	padding: 10px 14px;
	border: 1px solid #ead0d7;
	border-radius: 10px;
	background: #fff;
	color: var(--plusko-brand-dark);
	font-size: 14px;
	line-height: 1.4;
	text-align: left;
	cursor: pointer;
}

#plusko-widget .plusko-quick__button:hover,
#plusko-widget .plusko-quick__button:focus-visible {
	border-color: var(--plusko-brand);
	background: #fbeef1;
}

#plusko-widget .plusko-quick__button:focus-visible {
	outline: 2px solid var(--plusko-brand);
	outline-offset: 1px;
}

/* Conversation. */

#plusko-widget .plusko-msg {
	max-width: 85%;
	margin-top: 12px;
	padding: 10px 14px;
}

#plusko-widget .plusko-msg--user {
	margin-left: auto;
	border-radius: 12px;
	background: #fbeef1;
	color: #3a1620;
}

#plusko-widget .plusko-msg--bot {
	border-left: 3px solid var(--plusko-brand);
	border-radius: 4px 12px 12px 4px;
	background: #f5f5f6;
	color: #2b2b2b;
}

/* The fallback contact form needs the full width for its fields. */
#plusko-widget .plusko-msg--bot:has(.plusko-contact) {
	max-width: none;
}

#plusko-widget .plusko-msg__content p + p,
#plusko-widget .plusko-msg__content ul,
#plusko-widget .plusko-msg__content ol {
	margin-top: 8px;
}

#plusko-widget .plusko-msg__content ul,
#plusko-widget .plusko-msg__content ol {
	padding-left: 20px;
}

#plusko-widget .plusko-msg__content a {
	color: var(--plusko-brand);
	font-weight: 600;
	text-decoration: underline;
}

/* Buttons and inputs. */

#plusko-widget .plusko-button {
	padding: 10px 16px;
	border: 0;
	border-radius: 10px;
	background: var(--plusko-brand);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
}

#plusko-widget .plusko-button:hover {
	background: var(--plusko-brand-dark);
}

#plusko-widget .plusko-button:focus-visible {
	outline: 2px solid var(--plusko-brand);
	outline-offset: 2px;
}

#plusko-widget .plusko-button:disabled {
	opacity: 0.6;
	cursor: default;
}

#plusko-widget .plusko-ask {
	display: flex;
	gap: 8px;
	padding: 14px 18px;
	border-top: 1px solid #eeeef0;
	background: #fafafa;
}

#plusko-widget .plusko-input,
#plusko-widget .plusko-field input,
#plusko-widget .plusko-field textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #d4d4d8;
	border-radius: 10px;
	background: #fff;
	color: var(--plusko-text);
	font-size: 14px;
}

#plusko-widget .plusko-input {
	flex: 1 1 auto;
	min-width: 0;
}

#plusko-widget .plusko-input:focus,
#plusko-widget .plusko-field input:focus,
#plusko-widget .plusko-field textarea:focus {
	border-color: var(--plusko-brand);
	outline: 1px solid var(--plusko-brand);
	box-shadow: 0 0 0 4px rgba(187, 37, 72, 0.15);
}

/* Fallback contact form. */

#plusko-widget .plusko-contact {
	margin-top: 10px;
}

/* "Zatražite ponudu" button between the message and Plusko's own form. */
#plusko-widget .plusko-offer {
	margin: 14px 0;
}

#plusko-widget .plusko-field {
	margin-bottom: 8px;
}

#plusko-widget .plusko-field label {
	display: block;
	margin-bottom: 2px;
	font-size: 13px;
	font-weight: 700;
}

#plusko-widget .plusko-field textarea {
	resize: vertical;
}

#plusko-widget .plusko-feedback {
	margin-top: 8px;
	font-size: 14px;
}

#plusko-widget .plusko-feedback--success {
	color: #1e6b3a;
}

/* Accessibility helpers. */

#plusko-widget .plusko-visually-hidden,
#plusko-widget .plusko-hp {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* Small screens. */

@media (max-width: 600px) {
	#plusko-widget .plusko-trigger {
		right: 16px;
		bottom: 16px;
	}

	#plusko-widget .plusko-trigger__icon {
		height: 80px;
	}

	#plusko-widget .plusko-teaser {
		right: 58px; /* trigger 16 + mascot 44, minus 2 */
		bottom: 53px; /* tail at mouth height, about 69px */
		max-width: min(280px, calc(100vw - 74px));
	}

	/* Pinned between equal gutters: 100vw includes classic scrollbars, which
	   would shrink the left gutter on narrow desktop windows. */
	#plusko-widget .plusko-panel {
		left: 16px;
		right: 16px;
		bottom: 108px; /* trigger 16 + 80 + 12 gap */
		width: auto;
		max-width: none;
		max-height: calc(100vh - 124px);
	}
}

/* AI layer: shown while the answer is being prepared. */

#plusko-widget .plusko-msg--pending {
	color: #6b6b6b;
}
