/**
 * OFON skin for Roundcube (extends the elastic skin)
 * Loaded after elastic's compiled stylesheet, so equal-specificity rules win.
 * Palette sampled from the OFON logo: #FBB01F #FBA919 #F58220 #EB6A28 #E04E22
 */

:root {
	--ofon-amber: #FBA919;
	--ofon-orange: #F58220;
	--ofon-rust: #E04E22;
	--ofon-ink: #2A1F18;
	--ofon-muted: #7A6656;
	--ofon-cream: #FFF6EC;
	--ofon-line: #F0DDCB;
	--ofon-grad: linear-gradient(120deg, #FBA919 0%, #F58220 45%, #E04E22 100%);
}

body,
input,
select,
textarea,
button {
	font-family: ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
	color: var(--ofon-ink);
}

a {
	color: #C4471C;
}

a:hover {
	color: #9C3513;
}

::selection {
	background: #FDE3D2;
}

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

body.task-login {
	background:
		radial-gradient(900px 520px at 12% 0%, #FFE7CB 0%, rgba(255, 231, 203, 0) 62%),
		radial-gradient(760px 520px at 92% 100%, #FFD9C2 0%, rgba(255, 217, 194, 0) 60%),
		linear-gradient(180deg, #FFF9F1 0%, #FFF3E6 100%);
	overflow: auto;
}

body.task-login #layout {
	display: block;
	height: auto;
	min-height: 100vh;
}

body.task-login #layout-content.no-navbar {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	padding: 40px 16px;
}

body.task-login #layout-content.no-navbar::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background-image: radial-gradient(rgba(224, 78, 34, 0.16) 1px, transparent 1px);
	background-size: 26px 26px;
	-webkit-mask-image: radial-gradient(58% 58% at 50% 45%, #000 0%, transparent 75%);
	mask-image: radial-gradient(58% 58% at 50% 45%, #000 0%, transparent 75%);
}

.ofon-rays {
	position: absolute;
	right: 12%;
	top: 8%;
	width: 150px;
	height: 150px;
	opacity: 0.5;
	pointer-events: none;
}

.ofon-rays i {
	position: absolute;
	left: 50%;
	bottom: 0;
	width: 11px;
	height: 46px;
	margin-left: -5.5px;
	border-radius: 6px;
	background: var(--ofon-grad);
	transform-origin: 50% 100%;
}

.ofon-rays i:nth-child(1) { transform: rotate(-28deg); }
.ofon-rays i:nth-child(2) { transform: rotate(-58deg); }
.ofon-rays i:nth-child(3) { transform: rotate(-88deg); }

.ofon-card {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 334px;
	padding: 29px 28px 26px;
	background: #fff;
	border: 1px solid #F7E8DB;
	border-radius: 18px;
	box-shadow: 0 34px 58px -32px rgba(160, 74, 26, 0.42);
	text-align: left;
}

body.task-login #logo {
	position: static;
	display: block;
	width: auto;
	height: 35px;
	max-height: none;
	margin: 0;
	mix-blend-mode: multiply;
}

body.task-login .ofon-title {
	margin: 16px 0 4px;
	font-size: 21px;
	line-height: 1.2;
	font-weight: 800;
	letter-spacing: -0.01em;
	color: var(--ofon-ink);
}

body.task-login .ofon-sub {
	margin: 0 0 18px;
	font-size: 12.5px;
	line-height: 1.5;
	color: var(--ofon-muted);
}

body.task-login #login-form {
	position: static;
	top: auto;
	width: 100%;
	max-width: none;
	margin: 0;
}

body.task-login #login-form table,
body.task-login #login-form tbody,
body.task-login #login-form tr,
body.task-login #login-form td {
	display: block !important;
	width: 100% !important;
	margin: 0 !important;
	border: 0;
}

/* elastic's JS turns labels into placeholders and injects an icon group,
   which we do not want: keep the label above the field, drop the icon. */
body.task-login #login-form td.title {
	display: block !important;
	margin: 0 0 5px !important;
	padding: 0;
	text-align: left;
}

body.task-login #login-form td.title label {
	display: block;
	overflow: visible;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: #8A7361;
	line-height: 1.4;
}

body.task-login #login-form td.input {
	margin: 0 0 11px !important;
	padding: 0;
}

body.task-login #login-form .input-group-prepend,
body.task-login #login-form .input-group-text {
	display: none !important;
}

body.task-login #login-form .form-control {
	width: 100% !important;
	height: 39px;
	padding: 0 12px;
	font-size: 13px;
	color: var(--ofon-ink);
	background: #FFFDFA;
	border: 1px solid var(--ofon-line);
	border-radius: 10px;
	box-shadow: none;
	transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

body.task-login #login-form .form-control::placeholder {
	color: transparent !important;
}

body.task-login #login-form .form-control:focus {
	background: #fff;
	border-color: var(--ofon-orange);
	box-shadow: 0 0 0 3px rgba(245, 130, 32, 0.16);
	outline: 0;
}

body.task-login #login-form .formbuttons {
	margin: 6px 0 0;
	padding: 0;
}

body.task-login #login-form .button.mainaction {
	width: 100%;
	height: 41px;
	border: 0;
	border-radius: 10px;
	font-size: 13.5px;
	font-weight: 700;
	letter-spacing: 0.01em;
	/* elastic's ui.js adds bootstrap's .text-uppercase (!important) to this button */
	text-transform: none !important;
	color: #fff;
	background: var(--ofon-grad);
	box-shadow: 0 12px 22px -11px rgba(224, 78, 34, 0.75);
	transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

body.task-login #login-form .button.mainaction:hover {
	color: #fff;
	filter: saturate(1.06);
	transform: translateY(-1px);
	box-shadow: 0 16px 26px -11px rgba(224, 78, 34, 0.8);
}

@media (max-width: 760px) {
	.ofon-rays { display: none; }
}

/* ------------------------------------------------------------------ */
/* Webmail: taskbar rail                                               */
/* ------------------------------------------------------------------ */

#layout-menu,
#layout-menu .menu {
	background-color: #FFFCF8;
	border-right: 1px solid var(--ofon-line);
}

#layout-menu .popover-header {
	background-color: #fff !important;
	border-bottom: 1px solid var(--ofon-line);
}

#layout-menu #taskmenu a,
#layout-menu .special-buttons a {
	color: #8A7361;
}

#layout-menu #taskmenu a:hover,
#layout-menu .special-buttons a:hover {
	color: var(--ofon-rust);
}

#layout-menu #taskmenu a.selected,
#layout-menu #taskmenu a.selected .inner,
#layout-menu .special-buttons a.selected {
	color: var(--ofon-rust);
	background-color: #FCEBDC;
}

#layout-menu #taskmenu a.selected:hover,
#layout-menu .special-buttons a.selected:hover {
	color: var(--ofon-rust);
	background-color: #FCEBDC;
}

/* the rail already renders a logo in .popover-header, so brand it there
   instead of adding a second element to the task menu */
#layout-menu .popover-header img {
	max-width: 30px;
	max-height: 42px;
	padding: 0;
	mix-blend-mode: multiply;
}

#taskmenu a.compose {
	height: 34px;
	line-height: 34px;
	padding: 0;
	margin: 2px 4px 7px;
	background: var(--ofon-grad);
	border-radius: 10px;
	border: 0;
	color: #fff !important;
	box-shadow: 0 8px 16px -10px rgba(224, 78, 34, 0.9);
}

#taskmenu a.compose::before {
	float: none;
	display: block;
	margin: 0 auto;
	line-height: 34px;
	color: #fff;
}

/* ------------------------------------------------------------------ */
/* Webmail: sidebar, list, headers                                     */
/* ------------------------------------------------------------------ */

#layout-sidebar {
	background-color: #FFFCF8;
}

/* elastic paints these with #layout>div>.header, which outranks #layout-list .header */
#layout > div > .header {
	background-color: #fff;
	border-bottom-color: var(--ofon-line);
	color: var(--ofon-ink);
}

#layout > div > .header a.button {
	color: var(--ofon-ink);
}

#layout > div > .header a.button.icon:not(.disabled):focus,
#layout > div > .header a.button.icon:not(.disabled):hover {
	background-color: #FDF1E5;
}

#layout-sidebar .header,
#layout-list .header {
	background-color: #fff;
	border-bottom-color: var(--ofon-line);
	color: var(--ofon-ink);
}

#layout-list .header .header-title {
	color: var(--ofon-ink);
}

.listing li.selected,
.listing tr.selected td {
	background-color: #FDF1E5;
	color: var(--ofon-ink);
}

.listing li:hover,
.listing tr:hover td {
	background-color: #FFFBF6;
}

/* the folder list is ul.treelist.folderlist, so elastic's `ul.treelist li.selected>a`
   rule outranks a plain .folderlist selector */
#mailboxlist li a,
.folderlist li a {
	color: #4A3B31;
}

#mailboxlist li.selected > a,
.folderlist li.selected > a {
	background-color: #FCEBDC;
	color: #A83C14;
	font-weight: 700;
}

#mailboxlist li.mailbox .unreadcount,
#mailboxlist li.mailbox.recent > a > .unreadcount,
.folderlist li.mailbox .unreadcount,
.folderlist li.mailbox.recent > a > .unreadcount {
	background: #FDE3D2;
	color: #B8431A;
}

.messagelist tr.unread td.subject span.subject {
	color: var(--ofon-ink);
}

.messagelist td.subject span.msgicon,
.messagelist span.flagged::before {
	color: var(--ofon-orange);
}

/* ------------------------------------------------------------------ */
/* Webmail: controls                                                   */
/* ------------------------------------------------------------------ */

/* #quotadisplay carries the quota-widget class itself, not a child */
.quota-widget {
	color: var(--ofon-muted);
}

.quota-widget .bar {
	background-color: #fff;
	border-color: var(--ofon-line);
}

.quota-widget .value {
	background: linear-gradient(90deg, var(--ofon-amber), var(--ofon-rust));
	opacity: 1;
}

.searchbar {
	background-color: #FFFCF8;
	border-bottom-color: var(--ofon-line);
}

.searchbar form input,
.searchbar input {
	background: var(--ofon-cream);
	border: 1px solid var(--ofon-line);
	border-radius: 999px;
	color: var(--ofon-ink);
}

.searchbar form input:focus,
.searchbar input:focus {
	background: #fff;
	border-color: var(--ofon-orange);
	box-shadow: 0 0 0 3px rgba(245, 130, 32, 0.14);
	outline: 0;
}

.btn-primary {
	background: var(--ofon-grad);
	border-color: var(--ofon-rust);
}

.btn-primary:hover,
.btn-primary:focus {
	background: linear-gradient(120deg, #F9AE2C 0%, #E8561F 100%);
	border-color: #D8481C;
	box-shadow: 0 0 0 0.2rem rgba(224, 78, 34, 0.25);
}

.form-control:focus {
	border-color: var(--ofon-orange);
	box-shadow: 0 0 0 0.2rem rgba(245, 130, 32, 0.18);
}

.messagelist tr.selected td.subject span.subject,
#message-header > .subject {
	color: var(--ofon-ink);
}

#layout-content {
	background-color: #fff;
}

/* Mobile: taskbar popover follows the same light rail */
@media (max-width: 1023px) {
	#layout-menu .popover-header,
	#taskmenu {
		background-color: #fff !important;
	}

	#layout-menu .popover-header a,
	#taskmenu a {
		color: #8A7361 !important;
	}
}
