/**
 * Xalan skin for Roundcube — a thin layer over Elastic.
 *
 * Elastic is imported as-is and then re-tinted, so upgrading Roundcube keeps
 * working without re-compiling any LESS. The palette and the login backdrop are
 * the same tokens the website uses (xalan-next/src/app/globals.css).
 *
 * Only files that exist here override the parent skin, so images/logo.svg and
 * images/favicon.ico are picked up by Elastic's own templates automatically.
 */
@import url("../../elastic/styles/styles.min.css");

/* Inter, self-hosted (downloaded into fonts/ at image build time) — same
   typeface as the website, no request to a font CDN at runtime. */
@font-face {
	font-family: 'InterVariable';
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url('../fonts/inter-latin-wght-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;
}

/* Slovak diacritics (ľ š č ť ž ň ď ĺ ŕ) live in the latin-ext subset. */
@font-face {
	font-family: 'InterVariable';
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url('../fonts/inter-latin-ext-wght-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 {
	--x-navy-950: #04101f;
	--x-navy-900: #071a2e;
	--x-navy-800: #0a2540;
	--x-card: #0a2036;
	--x-line: #17304b;
	--x-muted: #8ba2bd;
	--x-fg: #dbe5f0;
	--x-heading: #f2f6fb;

	--x-brand-300: #8ec6ff;
	--x-brand-400: #59a6ff;
	--x-brand-500: #1071e5;
	--x-brand-600: #0b57b8;
	--x-accent-500: #06b6d4;

	--x-font: 'InterVariable', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
	--x-radius: 0.625rem;
}

/* ------------------------------------------------------------------ *
 * Typography — replaces Elastic's Roboto, matching its own selectors  *
 * so no !important is needed. Icon fonts are left alone.              *
 * ------------------------------------------------------------------ */
.popover,
body,
button,
input,
optgroup,
select,
textarea,
div.tox,
div.tox :not(.svg) {
	font-family: var(--x-font);
}

h1,
h2,
h3,
h4,
.header-title,
#login-form .formbuttons button {
	letter-spacing: -0.02em;
}

/* ------------------------------------------------------------------ *
 * Login screen                                                        *
 * ------------------------------------------------------------------ */

/* The site hero: two brand glows over a navy gradient. Always dark, like the
   hero on xalan.sk, regardless of the visitor's dark-mode preference. */
body.task-login,
body.task-error-login {
	background: var(--x-navy-900);
	color: var(--x-fg);
}

body.task-login #layout,
body.task-error-login #layout {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	min-height: 100dvh;
	padding: 2rem 1rem;
	overflow: auto;
	background:
		radial-gradient(80% 120% at 12% -10%, rgb(16 113 229 / 0.55) 0%, transparent 60%),
		radial-gradient(60% 100% at 95% 10%, rgb(6 182 212 / 0.22) 0%, transparent 55%),
		linear-gradient(180deg, #071a2e 0%, #0a2540 100%);
}

/* Faint grid, masked so it fades out towards the edges instead of ending on a
   hard line — the .bg-grid utility from the website. */
body.task-login #layout::before {
	content: '';
	position: absolute;
	inset: 0;
	pointer-events: none;
	background-image:
		linear-gradient(to right, rgb(255 255 255 / 0.05) 1px, transparent 1px),
		linear-gradient(to bottom, rgb(255 255 255 / 0.05) 1px, transparent 1px);
	background-size: 56px 56px;
	-webkit-mask-image: radial-gradient(70% 70% at 50% 30%, #000 0%, transparent 100%);
	mask-image: radial-gradient(70% 70% at 50% 30%, #000 0%, transparent 100%);
}

body.task-login #layout-content,
body.task-error-login #layout-content {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 25rem;
	background: none;
	border: 0;
	overflow: visible;
}

/* Elastic pushes the logo and the form down with `top: 16vh/20vh`; the flex
   centering above replaces that. */
body.task-login #logo {
	/* Point at the wordmark from here as well as from meta.json's skin_logo.
	   The stylesheet and the images ship together in this directory, so the
	   login logo stays right even if the skin_logo config and the image get
	   out of step - which is exactly what happens when config/ is pulled from
	   git but the image has not been rebuilt yet. */
	content: url('../images/xalan-logo.svg');
	position: static;
	top: auto;
	display: block;
	width: auto;
	max-width: 12rem;
	max-height: none;
	margin: 0 auto 2.25rem;
}

body.task-login #login-form {
	position: static;
	top: auto;
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 1.75rem;
	text-align: left;
	background: rgb(10 32 54 / 0.72);
	border: 1px solid var(--x-line);
	border-radius: 1rem;
	box-shadow: 0 24px 60px -20px rgb(4 16 31 / 0.85);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
}

/* Elastic's ui.js rewrites each row into a Bootstrap input-group: it hides the
   label cell (keeping it for screen readers), moves the text into the
   placeholder and prepends an icon. So only the table wrapper is flattened —
   the input cell has to stay a flex row or the icon detaches from its field. */
body.task-login #login-form table,
body.task-login #login-form tbody,
body.task-login #login-form tr {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
}

body.task-login #login-form tr + tr {
	margin-top: 0.875rem;
}

body.task-login #login-form td.input {
	display: flex;
	width: 100%;
	padding: 0;
	border: 0;
	border-radius: var(--x-radius);
	transition: box-shadow 0.15s ease;
}

body.task-login #login-form .input-group-text {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.875rem;
	height: 2.875rem;
	padding: 0;
	color: var(--x-muted);
	background: var(--x-navy-900);
	border: 1px solid var(--x-line);
	border-right: 0;
	border-radius: var(--x-radius) 0 0 var(--x-radius);
}

body.task-login #login-form .form-control {
	flex: 1 1 auto;
	min-width: 0;
	height: 2.875rem;
	padding: 0 0.875rem;
	color: var(--x-fg);
	background: var(--x-navy-900);
	border: 1px solid var(--x-line);
	border-left: 0;
	border-radius: 0 var(--x-radius) var(--x-radius) 0;
	box-shadow: none;
	transition: border-color 0.15s ease;
}

body.task-login #login-form .form-control::placeholder {
	color: rgb(139 162 189 / 0.65);
}

/* Ring the whole group, not just the input, so the icon box joins the focus. */
body.task-login #login-form .form-control:focus {
	box-shadow: none;
	outline: none;
}

body.task-login #login-form td.input:focus-within {
	box-shadow: 0 0 0 3px rgb(16 113 229 / 0.25);
}

body.task-login #login-form td.input:focus-within .input-group-text,
body.task-login #login-form td.input:focus-within .form-control {
	border-color: var(--x-brand-500);
}

/* Chrome paints autofilled inputs with an opaque light background; the inset
   shadow is the only way to keep them on-theme. */
body.task-login #login-form .form-control:-webkit-autofill,
body.task-login #login-form .form-control:-webkit-autofill:hover,
body.task-login #login-form .form-control:-webkit-autofill:focus {
	-webkit-text-fill-color: var(--x-fg);
	-webkit-box-shadow: inset 0 0 0 100vw var(--x-navy-900);
	caret-color: var(--x-fg);
}

body.task-login #login-form .formbuttons {
	margin: 1.5rem 0 0;
}

body.task-login #rcmloginsubmit {
	display: block;
	width: 100%;
	height: 2.875rem;
	color: #fff;
	font-size: 0.9375rem;
	font-weight: 600;
	background: var(--x-brand-500);
	border: 1px solid var(--x-brand-500);
	border-radius: var(--x-radius);
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

body.task-login #rcmloginsubmit:hover,
body.task-login #rcmloginsubmit:focus {
	background: var(--x-brand-600);
	border-color: var(--x-brand-600);
}

body.task-login #rcmloginsubmit:focus-visible {
	outline: 2px solid var(--x-brand-300);
	outline-offset: 2px;
}

body.task-login #login-footer {
	margin-top: 1.5rem;
	color: var(--x-muted);
	font-size: 0.8125rem;
	text-align: center;
}

body.task-login #login-footer a,
body.task-login #login-footer .support-link {
	color: var(--x-brand-300);
}

body.task-login #login-footer > div {
	margin-top: 1rem;
	background: rgb(255 255 255 / 0.04);
	border: 1px solid var(--x-line);
	border-radius: var(--x-radius);
}

body.task-login .noscriptwarning {
	position: relative;
	z-index: 1;
	max-width: 25rem;
	margin: 1rem auto;
	color: var(--x-fg);
}

/* Error banners ("Invalid username or password") sit above the card. */
body.task-login #messagestack div,
body.task-error-login #messagestack div {
	border-radius: var(--x-radius);
}

/* ------------------------------------------------------------------ *
 * Application chrome — Elastic's sky blue (#37beff / #00acff) swapped *
 * for the brand blue. Lighter tints on dark surfaces keep contrast.   *
 * ------------------------------------------------------------------ */

a {
	color: var(--x-brand-600);
}

.btn-link {
	color: var(--x-brand-600);
}

.btn-primary,
.btn-primary.disabled,
.btn-primary:disabled,
div.tox .tox-dialog__footer .tox-button,
div.tox .tox-dialog__footer .tox-button.disabled,
div.tox .tox-dialog__footer .tox-button:disabled,
div.tox .tox-dialog__footer .tox-button:focus:not(:disabled) {
	background: var(--x-brand-500);
	border-color: var(--x-brand-500);
}

.floating-action-buttons a.button,
.quota-widget .value,
.ui-slider .ui-slider-handle.ui-state-active {
	background: var(--x-brand-500);
}

.ui-menu .ui-state-active {
	background-color: var(--x-brand-500) !important;
}

.ui-datepicker a.ui-state-active {
	background: var(--x-brand-500) !important;
}

.ui-datepicker .ui-datepicker-days-cell-over a,
.ui-datepicker .ui-datepicker-days-cell-over a.ui-state-active {
	color: var(--x-brand-500);
}

.popover .menu li a:not(.disabled):hover,
.popover .menu .dropbutton a.dropdown:hover,
.popupmenu .listing li > a:not(.disabled):hover,
.popupmenu .listing li.selected,
#messagestack .alert-info.information {
	background-color: var(--x-brand-500);
}

.folderlist li.mailbox .unreadcount,
.folderlist li.mailbox.recent > a > .unreadcount {
	background: var(--x-brand-500);
}

/* Focus rings on inputs across the app. */
.form-control:focus,
.multi-input > .content.focused,
.recipient-input.focus,
.tagedit-list[tabindex='-1'],
.custom-file-input:focus ~ .custom-file-label,
.formcontent.raweditor .CodeMirror-focused,
.custom-switch .custom-control-input:focus:not(:checked) ~ .custom-control-label::before,
div.tox .tox-color-input > input:focus,
div.tox .tox-listboxfield .tox-listbox--select:focus,
div.tox .tox-textarea:focus,
div.tox .tox-textfield:focus {
	border-color: var(--x-brand-500);
}

.input-group-text input:focus,
div.tox.focused {
	border-color: var(--x-brand-500) !important;
}

.custom-switch .custom-control-input:checked ~ .custom-control-label::before {
	border-color: var(--x-brand-500);
	background-color: var(--x-brand-500);
}

.ui.alert a:not(.btn),
.googie_list li.googie_list_onhover {
	color: #fff;
	background-color: var(--x-brand-500);
}

.ui.alert a:not(.btn) {
	color: var(--x-brand-600);
	background: none;
}

/* The task rail is dark in both modes, so it takes the navy from the site
   header and the lighter brand tint for its icons. #layout-menu is the rail
   itself (logo header included); #taskmenu is the task list inside it — both
   need the colour or the logo strip stays Elastic's grey. */
#layout-menu,
#taskmenu {
	background-color: var(--x-navy-800);
}

/* Elastic sets this one !important, so matching it is the only way. */
#layout-menu .popover-header {
	background-color: var(--x-navy-800) !important;
}

/* The rail is only ~78px wide, where the full wordmark shrinks to ~35px tall
   and stops being readable. Swap in the head mark on its own. `content` on an
   <img> is honoured by every evergreen browser; anywhere it is not, the
   wordmark simply stays. */
#layout-menu #logo {
	content: url('../images/xalan-mark.svg');
	display: block;
	width: 2.5rem;
	height: 2.5rem;
	margin: 0.5rem auto;
}

#taskmenu a.selected,
#taskmenu a.selected:hover,
#taskmenu a:hover,
#taskmenu a:focus,
#taskmenu .action-buttons a:hover {
	background: rgb(16 113 229 / 0.22);
}

#taskmenu .special-buttons {
	background-color: var(--x-navy-900);
}

#taskmenu .action-buttons a,
#taskmenu .action-buttons a:hover {
	color: var(--x-brand-400);
}

/* Dark mode: same hues, one step lighter so they stay legible. */
html.dark-mode a,
html.dark-mode .btn-link,
html.dark-mode #taskmenu .action-buttons a,
html.dark-mode .listing li.selected,
html.dark-mode .listing li.selected > a,
html.dark-mode .messagelist tr:not(.flagged):not(.deleted).selected td.subject a,
html.dark-mode .tox .tox-dialog__body-nav-item--active,
html.dark-mode .tox .tox-collection__item--enabled,
html.dark-mode .ui-datepicker .ui-state-highlight,
html.dark-mode .ui-datepicker.ui-widget-content .ui-state-highlight {
	color: var(--x-brand-400);
}

html.dark-mode .custom-file-label:focus:not(.is-invalid),
html.dark-mode .form-control:focus:not(.is-invalid),
html.dark-mode .multi-input:not(.is-invalid) > .content.focused,
html.dark-mode .input-group a:focus,
html.dark-mode .recipient-input.focus,
html.dark-mode .formcontent.raweditor .CodeMirror-focused {
	border-color: var(--x-brand-500);
}

/* ------------------------------------------------------------------ *
 * Calendar — keep the plugin's own widgets on the brand palette       *
 * ------------------------------------------------------------------ */
#calendartoolbar .btn.active,
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
	background: var(--x-brand-500);
	border-color: var(--x-brand-500);
}

.fc .fc-daygrid-day.fc-day-today,
.fc .fc-timegrid-col.fc-day-today {
	background: rgb(16 113 229 / 0.08);
}

.fc .fc-timegrid-now-indicator-line,
.fc .fc-timegrid-now-indicator-arrow {
	border-color: var(--x-accent-500);
}
