/*
 * Brezno kiosk – full-screen touch UI. Sizes derive from the screen (vmin), so the same layout
 * works from small touch panels to large 4K totems, in landscape and portrait. Colors follow brezno.sk.
 */

@font-face {
	font-family: 'Lato';
	font-weight: 400;
	font-display: swap;
	src: url(../fonts/lato-latin-400-normal.woff2) format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'Lato';
	font-weight: 400;
	font-display: swap;
	src: url(../fonts/lato-latin-ext-400-normal.woff2) format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: 'Lato';
	font-weight: 700;
	font-display: swap;
	src: url(../fonts/lato-latin-700-normal.woff2) format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'Lato';
	font-weight: 700;
	font-display: swap;
	src: url(../fonts/lato-latin-ext-700-normal.woff2) format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: 'Lato';
	font-weight: 900;
	font-display: swap;
	src: url(../fonts/lato-latin-900-normal.woff2) format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'Lato';
	font-weight: 900;
	font-display: swap;
	src: url(../fonts/lato-latin-ext-900-normal.woff2) format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}


:root {
	--red: #cc2727;
	--red-dark: #9c1b1b;
	--red-soft: #fbeaea;
	--blue: #1253bc;
	--blue-dark: #0b3b8a;
	--blue-soft: #e7eefa;
	--ink: #172033;
	--muted: #5b6477;
	--line: #dce1ea;
	--surface: #fff;
	--background: #eef1f6;

	--topbar-height: clamp(72px, 9vh, 120px);
	--gap: clamp(16px, 2.2vmin, 40px);
	--radius: clamp(14px, 1.8vmin, 28px);
	--shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 6px 20px rgb(16 24 40 / 7%);

	font-size: clamp(16px, 1.9vmin, 30px);
}

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

html {
	height: 100%;
	touch-action: pan-x pan-y; /* no pinch zoom */
}

body {
	height: 100%;
	margin: 0;
	overflow: hidden;
	font-family: 'Lato', system-ui, sans-serif;
	color: var(--ink);
	background: var(--background);
	-webkit-font-smoothing: antialiased;
	-webkit-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
	-webkit-tap-highlight-color: transparent;
	overscroll-behavior: none;
}

button {
	font: inherit;
	color: inherit;
	cursor: pointer;
	touch-action: manipulation;
}

:focus:not(:focus-visible) {
	outline: none;
}

[hidden] {
	display: none !important;
}

.sprite {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
}

.icon {
	flex: none;
	width: 1em;
	height: 1em;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5em;
	min-height: 3.2rem;
	padding: 0 1.8em;
	border: 0;
	border-radius: 999px;
	background: var(--blue);
	color: #fff;
	font-size: 1.15rem;
	font-weight: 700;
	transition: transform .15s ease, filter .15s ease;
}

.button:active {
	transform: scale(.97);
	filter: brightness(.9);
}


/* top bar */

.topbar {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: var(--gap);
	height: var(--topbar-height);
	padding: 0 var(--gap);
	background: var(--surface);
	box-shadow: 0 1px 0 var(--line), 0 4px 16px rgb(16 24 40 / 5%);
}

.brand {
	display: flex;
	align-items: center;
	gap: .7em;
}

.brand-logo {
	height: calc(var(--topbar-height) * .64);
	width: auto;
}

.brand-name {
	font-size: 1.9rem;
	font-weight: 900;
	line-height: 1;
	letter-spacing: .3em;
	text-transform: uppercase;
}

.brand-sub {
	margin-top: .35em;
	font-size: .9rem;
	color: var(--muted);
}

.back-button {
	display: none;
	align-items: center;
	gap: .5em;
	height: calc(var(--topbar-height) * .66);
	padding: 0 1.3em 0 1em;
	border: 2px solid var(--line);
	border-radius: 999px;
	background: var(--surface);
	font-size: 1.2rem;
	font-weight: 700;
	transition: background .15s ease;
}

.back-button .icon {
	font-size: 1.4em;
	color: var(--blue);
}

.back-button:active {
	background: var(--blue-soft);
}

.topbar-title {
	margin: 0;
	font-size: 1.6rem;
	font-weight: 900;
}

body:not([data-view="home"]) .brand {
	display: none;
}

body:not([data-view="home"]) .back-button {
	display: inline-flex;
}

.clock {
	margin-left: auto;
	text-align: right;
	line-height: 1.1;
}

.clock-time {
	font-size: 2rem;
	font-weight: 900;
	font-variant-numeric: tabular-nums;
}

.clock-date {
	font-size: .9rem;
	color: var(--muted);
}


/* views */

main {
	position: relative;
	height: calc(100% - var(--topbar-height));
}

.view {
	height: 100%;
	animation: view-in .35s ease both;
}

@keyframes view-in {
	from {
		opacity: 0;
		transform: translateY(1.5vh);
	}
}

.notice {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1.2em;
	margin: 0;
	padding: 3em 1em;
	text-align: center;
	font-size: 1.2rem;
	line-height: 1.5;
	color: var(--muted);
}

.notice p {
	margin: 0;
}

.notice strong {
	color: var(--ink);
}

.notice-icon {
	font-size: 3.2em;
	color: var(--red);
}

.spinner {
	width: 3em;
	height: 3em;
	border: .3em solid var(--line);
	border-top-color: var(--blue);
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(1turn);
	}
}


/* home: two big choices */

.view-home {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--gap);
	padding: var(--gap);
}

@media (orientation: portrait) {
	.view-home {
		grid-template-columns: none;
		grid-template-rows: 1fr 1fr;
	}
}

.choice {
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: .55em;
	padding: clamp(24px, 5vmin, 96px);
	border: 0;
	border-radius: calc(var(--radius) * 1.6);
	color: #fff;
	text-align: left;
	font-size: clamp(18px, 2.7vmin, 44px);
	box-shadow: 0 24px 48px -16px rgb(16 24 40 / 40%);
	transition: transform .15s ease, filter .15s ease;
}

.choice:active {
	transform: scale(.985);
	filter: brightness(.93);
}

.choice-chat {
	background:
		radial-gradient(circle at 88% 8%, rgb(255 255 255 / 16%), transparent 45%),
		linear-gradient(155deg, var(--red) 10%, var(--red-dark) 100%);
}

.choice-contacts {
	background:
		radial-gradient(circle at 88% 8%, rgb(255 255 255 / 16%), transparent 45%),
		linear-gradient(155deg, var(--blue) 10%, var(--blue-dark) 100%);
}

/* decorative rings */
.choice::before,
.choice::after {
	content: '';
	position: absolute;
	border-radius: 50%;
	pointer-events: none;
}

.choice::before {
	top: -30%;
	right: -22%;
	width: 75%;
	aspect-ratio: 1;
	background: rgb(255 255 255 / 6%);
}

.choice::after {
	top: -12%;
	right: -6%;
	width: 42%;
	aspect-ratio: 1;
	border: .12em solid rgb(255 255 255 / 12%);
}

.choice-icon {
	display: grid;
	place-items: center;
	width: 3.8em;
	height: 3.8em;
	margin-bottom: auto;
	border-radius: 30%;
	background: rgb(255 255 255 / 16%);
	box-shadow: inset 0 0 0 1px rgb(255 255 255 / 18%);
}

.choice-icon .icon {
	width: 58%;
	height: 58%;
	stroke-width: 1.7;
}

.choice-title {
	font-size: 2.7em;
	font-weight: 900;
	line-height: 1.05;
	letter-spacing: -.01em;
}

.choice-text {
	max-width: 25em;
	font-size: .95em;
	line-height: 1.45;
	opacity: .92;
}

.choice-cta {
	display: inline-flex;
	align-items: center;
	gap: .5em;
	margin-top: 1em;
	padding: .85em 1.5em;
	border-radius: 999px;
	background: #fff;
	color: var(--red);
	font-size: .95em;
	font-weight: 900;
	box-shadow: 0 8px 20px -6px rgb(0 0 0 / 35%);
}

.choice-contacts .choice-cta {
	color: var(--blue);
}

.choice-cta .icon {
	stroke-width: 2.6;
	animation: nudge 2.4s ease-in-out infinite;
}

@keyframes nudge {
	0%, 60%, 100% {
		transform: none;
	}
	30% {
		transform: translateX(.3em);
	}
}


/* chat: the Citymind widget (its own shadow DOM) is laid over this view, see widgetCss in kiosk.js */

.view-chat {
	display: grid;
	place-items: center;
}

#shadow-root {
	position: relative;
	z-index: 1; /* the widget uses the maximal z-index, keep it under the kiosk top bar */
}

body:not([data-view="chat"]) #shadow-root {
	display: none !important;
}


/* contacts */

.view-contacts {
	display: flex;
	flex-direction: column;
}

.contacts-toolbar {
	flex: none;
	display: flex;
	flex-direction: column;
	gap: calc(var(--gap) * .6);
	padding: var(--gap) var(--gap) calc(var(--gap) * .5);
}

.search {
	position: relative;
	display: flex;
	align-items: center;
}

.search > .icon {
	position: absolute;
	left: 1.1rem;
	font-size: 1.5rem;
	color: var(--muted);
	pointer-events: none;
}

.search-input {
	width: 100%;
	height: 3.6rem;
	padding: 0 4rem 0 3.6rem;
	border: 2px solid var(--line);
	border-radius: 999px;
	outline: none;
	background: var(--surface);
	color: var(--ink);
	font: inherit;
	font-size: 1.35rem;
	-webkit-user-select: text;
	user-select: text;
	appearance: none;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.search-input::placeholder {
	color: #8a93a5;
}

.search-input:focus {
	border-color: var(--blue);
	box-shadow: 0 0 0 .25rem rgb(18 83 188 / 15%);
}

.search-input::-webkit-search-cancel-button {
	display: none;
}

.search-clear {
	position: absolute;
	right: .5rem;
	display: grid;
	place-items: center;
	width: 2.6rem;
	height: 2.6rem;
	border: 0;
	border-radius: 50%;
	background: var(--background);
	font-size: 1.3rem;
}

.letters {
	display: flex;
	flex-wrap: wrap;
	gap: .45rem;
}

.letter {
	min-width: 2.7rem;
	height: 2.7rem;
	padding: 0 .55rem;
	border: 0;
	border-radius: .8rem;
	background: var(--surface);
	color: var(--blue);
	font-size: 1.15rem;
	font-weight: 900;
	box-shadow: 0 1px 2px rgb(16 24 40 / 10%);
	transition: background .15s ease, color .15s ease;
}

.letter:active {
	background: var(--blue);
	color: #fff;
}

.letter:disabled {
	opacity: .3;
	box-shadow: none;
}

.contacts-scroll {
	flex: 1;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 0 var(--gap) var(--gap);
}

.group {
	scroll-margin-top: .5rem;
}

.group-letter {
	display: flex;
	align-items: center;
	gap: .6em;
	margin: 1em 0 .5em;
	font-size: 1.8rem;
	font-weight: 900;
	color: var(--blue);
}

.group-letter::after {
	content: '';
	flex: 1;
	height: 2px;
	background: var(--line);
}

.group-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 23.5rem), 1fr));
	gap: calc(var(--gap) * .6);
}

.contact {
	display: flex;
	flex-direction: column;
	padding: 1.1rem 1.2rem 1.2rem;
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow);
}

.contact-name {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 900;
	line-height: 1.2;
}

.contact-titles {
	margin: .2em 0 0;
	font-size: .95rem;
	color: var(--muted);
}

.contact-actions {
	display: grid;
	gap: .5rem;
	margin-top: .9rem;
}

.action {
	display: flex;
	align-items: center;
	gap: .7em;
	min-height: 3.3rem;
	padding: .5em .6em .5em .9em;
	border: 0;
	border-radius: .9rem;
	background: #f1f4f9;
	text-align: left;
	font-size: 1.15rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	transition: background .15s ease;
}

.action:active {
	background: var(--blue-soft);
}

.action > .icon:first-child {
	font-size: 1.3em;
	color: var(--blue);
}

.action-email > .icon:first-child {
	color: var(--red);
}

.action span {
	flex: 1;
	min-width: 0;
	overflow-wrap: anywhere;
}

.action-email span {
	font-size: .92em;
}

.action > .icon:last-child {
	font-size: 1.25em;
	color: #9aa3b4;
}

.contacts-source {
	margin: 2.5em 0 1em;
	text-align: center;
	font-size: .9rem;
	color: var(--muted);
}


/* dialogs */

dialog {
	padding: 0;
	border: 0;
	color: inherit;
	background: var(--surface);
	border-radius: calc(var(--radius) * 1.6);
	box-shadow: 0 30px 80px rgb(0 0 0 / 35%);
}

dialog[open] {
	animation: pop .25s ease both;
}

dialog:focus {
	outline: none;
}

dialog::backdrop {
	background: rgb(10 18 36 / 62%);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
}

@keyframes pop {
	from {
		opacity: 0;
		transform: scale(.96);
	}
}

.qr-dialog {
	width: min(92vw, 64rem);
	max-height: 94vh;
}

.qr-card {
	display: grid;
	grid-template-columns: auto 1fr;
	align-items: center;
	gap: clamp(24px, 4vmin, 64px);
	padding: clamp(24px, 4vmin, 64px);
}

.qr-code {
	width: min(60vh, 42vw, 34rem);
	aspect-ratio: 1;
}

.qr-code svg {
	display: block;
	width: 100%;
	height: 100%;
}

.qr-info {
	min-width: 0;
}

.qr-kind {
	display: inline-flex;
	align-items: center;
	gap: .5em;
	margin: 0;
	padding: .45em 1.1em .45em .9em;
	border-radius: 999px;
	background: var(--blue-soft);
	color: var(--blue);
	font-size: 1.1rem;
	font-weight: 900;
}

.qr-kind .icon {
	font-size: 1.2em;
}

.qr-dialog[data-kind="email"] .qr-kind {
	background: var(--red-soft);
	color: var(--red);
}

.qr-title {
	display: -webkit-box;
	overflow: hidden;
	margin: .7em 0 0;
	font-size: 1.9rem;
	font-weight: 900;
	line-height: 1.15;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

.qr-value {
	margin: .25em 0 0;
	font-size: 2.3rem;
	font-weight: 900;
	line-height: 1.15;
	color: var(--blue);
	overflow-wrap: anywhere;
	font-variant-numeric: tabular-nums;
}

.qr-dialog[data-kind="email"] .qr-value {
	font-size: 1.8rem;
	color: var(--red);
}

.qr-dialog[data-kind="link"] .qr-value {
	font-size: 1.3rem;
	font-weight: 700;
}

.qr-hint {
	display: flex;
	align-items: flex-start;
	gap: .6em;
	margin: 1.3em 0 1.6em;
	font-size: 1.15rem;
	line-height: 1.45;
	color: var(--muted);
}

.qr-hint .icon {
	font-size: 1.7em;
	color: var(--ink);
}

.qr-close {
	min-width: 12rem;
	min-height: 3.6rem;
}

@media (orientation: portrait) {
	.qr-card {
		grid-template-columns: none;
		justify-items: center;
		text-align: center;
	}

	.qr-code {
		width: min(44vh, 76vw, 34rem);
	}

	.qr-hint {
		justify-content: center;
		text-align: left;
	}
}

.idle-dialog {
	width: min(90vw, 34rem);
}

.idle-dialog[open] {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: clamp(24px, 4vmin, 56px);
	text-align: center;
}

.idle-timer {
	position: relative;
	width: 7rem;
	height: 7rem;
}

.idle-ring {
	width: 100%;
	height: 100%;
	transform: rotate(-90deg);
}

.idle-ring circle {
	fill: none;
	stroke-width: 10;
}

.idle-ring-track {
	stroke: var(--line);
}

.idle-ring-progress {
	stroke: var(--red);
	stroke-linecap: round;
	stroke-dasharray: 100;
	transition: stroke-dashoffset 1s linear;
}

.idle-count {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	font-size: 2.6rem;
	font-weight: 900;
	font-variant-numeric: tabular-nums;
}

.idle-dialog h2 {
	margin: .6em 0 .2em;
	font-size: 2rem;
	font-weight: 900;
}

.idle-dialog p {
	margin: 0 0 1.4em;
	font-size: 1.15rem;
	line-height: 1.45;
	color: var(--muted);
}

.idle-continue {
	min-width: 12rem;
	min-height: 3.6rem;
}


@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
	}
}
