/* Ofimare 1.0.2 — Elastic extension, Roundcube 1.7.5.
 * CC BY-SA 3.0. Brand assets belong to Ofimare. */
@font-face {
  font-family: "Rethink Sans";
  src: url("../fonts/RethinkSans.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}
:root {
  --of-navy: #00305b;
  --of-orange: #f18700;
  --of-bg: #f5f1e9;
  --of-pane: #ffffff;
  --of-text: #21384b;
  --of-muted: #596b7a;
  --of-border: #dbe2e8;
  --of-hover: #edf3f7;
  --of-selected: #e4edf5;
  --of-link: #00305b;
  --of-focus: #00305b;
}
html.dark-mode {
  --of-bg: #101f2e;
  --of-pane: #182a3b;
  --of-text: #edf3f8;
  --of-muted: #b3c2ce;
  --of-border: #34495c;
  --of-hover: #21394e;
  --of-selected: #29445c;
  --of-link: #c5ddf2;
  --of-focus: #f18700;
}
html, body, input, select, textarea, button, .popover, .tooltip {
  font-family: "Rethink Sans", Arial, sans-serif;
}
body { color: var(--of-text); background: var(--of-pane); }
/* Preserve the supplied white artwork; Elastic otherwise dims logos in dark mode. */
html.dark-mode #logo { opacity: 1; }
a { color: var(--of-link); }
a:hover { color: var(--of-link); }
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--of-focus) !important;
  outline-offset: 3px;
}
.form-control, .custom-select {
  color: var(--of-text);
  background-color: var(--of-pane);
  border-color: var(--of-border);
  border-radius: 6px;
}
.form-control:focus, .custom-select:focus {
  color: var(--of-text);
  background-color: var(--of-pane);
  border-color: var(--of-focus);
  box-shadow: 0 0 0 .15rem rgba(0,48,91,.12);
}
.btn-primary, .btn-primary:disabled, .btn-primary.disabled {
  color: #fff;
  background-color: var(--of-navy);
  border-color: var(--of-navy);
}
.btn-primary:hover, .btn-primary:focus,
.btn-primary:not(:disabled):not(.disabled):active {
  background-color: #07446f;
  border-color: #07446f;
  color: #fff;
}
.custom-control-input:checked ~ .custom-control-label::before {
  background-color: var(--of-navy); border-color: var(--of-navy);
}
html.dark-mode .custom-control-input:checked ~ .custom-control-label::before {
  background-color: #517f9f; border-color: #517f9f;
}

/* Navigation and application chrome; retain Elastic sizing and touch controls. */
#layout-menu, #layout-menu .popover-header,
html.dark-mode #layout-menu, html.dark-mode #layout-menu .popover-header {
  background: var(--of-navy) !important;
  color: #fff;
}
#layout-menu .popover-header { display: flex; align-items: center; justify-content: center; }
#taskmenu .special-buttons { background: var(--of-navy) !important; }
html.dark-mode #layout-menu .special-buttons a:not(:hover):not(:focus) { background: var(--of-navy); }
#layout-menu .popover-header img#logo {
  width: 44px; height: auto; max-width: 44px; max-height: 40px;
  padding: 0; margin: 0 12px; object-fit: contain;
}
#taskmenu a, html.dark-mode #taskmenu a {
  color: #edf4fa; border-color: rgba(255,255,255,.13) !important;
}
#taskmenu a:hover, #taskmenu a:focus,
html.dark-mode #taskmenu a:hover, html.dark-mode #taskmenu a:focus {
  background: #164c77; color: #fff;
}
#taskmenu a.selected, html.dark-mode #taskmenu a.selected {
  color: #fff; background: #12456f; box-shadow: inset 3px 0 0 var(--of-orange);
}
#taskmenu a.compose, html.dark-mode #taskmenu a.compose {
  background: var(--of-orange); color: var(--of-navy);
}
#taskmenu a.compose:hover, #taskmenu a.compose:focus,
html.dark-mode #taskmenu a.compose:hover {
  background: #ffa327; color: var(--of-navy);
}
#taskmenu a.logout, html.dark-mode #taskmenu a.logout { color: #edf4fa; }
#layout-menu a:focus-visible { outline-color: #fff !important; outline-offset: -4px; }
#layout-sidebar, #layout-sidebar .header, #layout-sidebar .footer,
html.dark-mode #layout-sidebar, html.dark-mode #layout-sidebar .header,
html.dark-mode #layout-sidebar .footer {
  background: var(--of-bg); color: var(--of-text); border-color: var(--of-border);
}
#layout-list, #layout-content,
html.dark-mode #layout-list, html.dark-mode #layout-content {
  background: var(--of-pane); color: var(--of-text); border-color: var(--of-border);
}
#layout-list > .header, #layout-content > .header,
#layout-list > .footer, #layout-content > .footer,
html.dark-mode #layout-list > .header, html.dark-mode #layout-content > .header,
html.dark-mode #layout-list > .footer, html.dark-mode #layout-content > .footer {
  background: var(--of-pane); color: var(--of-text); border-color: var(--of-border);
}
.listing li, .listing tbody td,
html.dark-mode .listing li, html.dark-mode .listing tbody td { border-color: var(--of-border); }
.listing li > a, html.dark-mode .listing li > a { color: var(--of-text); }
.listing li:hover > a, html.dark-mode .listing li:hover > a { background: var(--of-hover); }
.listing li.selected > a, .listing li.selected > div,
html.dark-mode .listing li.selected > a, html.dark-mode .listing li.selected > div {
  background: var(--of-selected); color: var(--of-text);
  box-shadow: inset 3px 0 0 var(--of-orange);
}
.folderlist li.selected > a { font-weight: 700; }
.folderlist .unreadcount {
  background: var(--of-navy); color: #fff; border-radius: 10px;
}
#mailboxlist .unreadcount { background: var(--of-navy); color: #fff; }
html.dark-mode #mailboxlist .unreadcount { background: #d5e5f1; color: var(--of-navy); }
html.dark-mode .folderlist .unreadcount { background: #d5e5f1; color: var(--of-navy); }
#messagelist tr:hover td, html.dark-mode #messagelist tr:hover td { background: var(--of-hover); }
#messagelist tr.selected td, html.dark-mode #messagelist tr.selected td {
  background: var(--of-selected); color: var(--of-text);
}
#messagelist tr.selected td:first-child { box-shadow: inset 3px 0 0 var(--of-orange); }
#messagelist .subject a, html.dark-mode #messagelist .subject a { color: var(--of-text); }
.searchbar, html.dark-mode .searchbar { background: var(--of-pane); border-color: var(--of-border); }
.menu a, html.dark-mode .menu a { color: var(--of-link); }
.menu a.disabled, html.dark-mode .menu a.disabled { opacity: .45; }
.listing .unread, .listing .unread a { font-weight: 700; }
.listing .flagged .flag, .listing .flagged .flagged { color: #a45a00; }
html.dark-mode .listing .flagged .flag, html.dark-mode .listing .flagged .flagged { color: #ffb44c; }

/* Login: actual Roundcube form and hooks are retained. */
body.task-login { overflow-y: auto; background: var(--of-bg); }
.task-login #layout { min-height: 100vh; min-height: 100dvh; height: auto; }
.task-login #layout-content.ofimare-login {
  display: grid; grid-template-columns: minmax(360px, 45%) minmax(0, 1fr);
  min-height: 100vh; min-height: 100dvh; width: 100%; text-align: left;
  padding: 0; overflow: visible; background: var(--of-bg);
}
.ofimare-welcome {
  position: relative; isolation: isolate; overflow: hidden;
  background: #00305b; color: #fff;
  padding: clamp(48px, 7vw, 108px) clamp(32px, 5vw, 78px);
  display: flex; flex-direction: column; align-items: flex-start;
}
.ofimare-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .24em; }
.ofimare-eyebrow::before {
  content: ''; display: inline-block; width: 24px; height: 3px;
  background: var(--of-orange); vertical-align: middle; margin-right: 14px;
}
.ofimare-welcome h2 {
  font-size: clamp(42px, 4.8vw, 72px); line-height: 1.06; letter-spacing: -.045em;
  font-weight: 700; margin: clamp(64px, 12vh, 130px) 0 24px; position: relative; z-index: 1;
}
.ofimare-welcome h2 span { color: #f18700; }
.ofimare-welcome p { font-size: 18px; line-height: 1.65; color: #e2eaf2; max-width: 290px; z-index: 1; }
.ofimare-site, .ofimare-site:hover {
  color: #fff !important; margin-top: auto; padding-top: 96px;
  text-decoration: none; font-size: 14px; z-index: 1;
}
.ofimare-site span { margin-left: 16px; color: var(--of-orange); }
.ofimare-horizon { position: absolute; inset: auto -75% -52% -40%; height: 94%; z-index: -1; transform: rotate(-16deg); }
.ofimare-horizon i { display: block; position: absolute; inset: 0; border: 1px solid #376285; border-radius: 50%; }
.ofimare-horizon i:nth-child(2) { inset: 36px; border-color: #376285; }
.ofimare-horizon i:nth-child(3) { inset: 72px; border-color: #55758c; }
.ofimare-access { display: flex; align-items: center; justify-content: center; padding: 60px 44px; }
.ofimare-login-inner { width: 100%; max-width: 370px; }
.task-login #logo {
  position: static; top: auto; display: block; width: 238px;
  max-width: 100%; height: auto; max-height: none; margin: 0 0 64px; padding: 0;
}
.ofimare-form-heading h1 { font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -.035em; margin: 0 0 32px; }
.ofimare-form-heading p { color: var(--of-muted); font-size: 15px; line-height: 1.6; margin: 0 0 32px; max-width: 330px; }
.task-login #login-form { top: auto; width: 100%; max-width: none; margin: 0; position: static; }
.task-login #login-form .form-control, .task-login #login-form .custom-select {
  height: 50px; min-height: 50px; font-size: 15px;
  border-color: #aebdc8; color: var(--of-text); background: var(--of-pane);
}
.task-login #login-form .input-group-text {
  background: var(--of-pane); color: var(--of-muted); border-color: #aebdc8;
  border-radius: 6px 0 0 6px; min-width: 46px; justify-content: center;
}
.task-login #login-form .input-group { margin-bottom: 18px; }
.task-login #login-form input::placeholder { color: var(--of-muted); opacity: 1; }
.task-login #login-form .formbuttons { margin-top: 24px; }
.task-login #rcmloginsubmit {
  height: 50px; width: 100%; font-size: 16px; font-weight: 700;
  border-radius: 6px; border: 1px solid var(--of-navy);
  background: var(--of-navy); color: #fff;
}
.task-login #rcmloginsubmit:hover, .task-login #rcmloginsubmit:focus { background: #07446f; border-color: #07446f; }
.task-login #login-footer { margin-top: 30px; color: var(--of-muted); font-size: 12px; line-height: 1.8; text-align: left; }
.task-login #login-footer .support-link { display: block; font-size: 13px; margin-top: 8px; }
.task-login #login-footer > div { margin-top: 12px; }
html.dark-mode .task-login #rcmloginsubmit { background: var(--of-orange); border-color: var(--of-orange); color: var(--of-navy); }
html.dark-mode .task-login #rcmloginsubmit:hover { background: #ffa327; }
html.dark-mode .task-login #login-form .form-control,
html.dark-mode .task-login #login-form .input-group-text { border-color: #687e91; }
@media (min-width: 481px) and (max-width: 1200px) {
  #layout-menu .popover-header img#logo { width: 28px; max-width: 28px; margin: 0 8px; }
}
@media (max-width: 900px) {
  .task-login #layout-content.ofimare-login { grid-template-columns: 1fr; }
  .ofimare-welcome { display: none; }
  .ofimare-access { padding: 48px 28px; border-top: 6px solid var(--of-navy); }
  .task-login #logo { margin-bottom: 48px; }
}
@media (max-width: 480px) {
  .ofimare-access { align-items: flex-start; padding: 48px 28px 32px; }
  .ofimare-form-heading h1 { font-size: 26px; }
  .task-login #logo { width: 225px; }
  #layout-menu .popover-header img#logo { width: 44px; max-width: 44px; }
}
@media (prefers-reduced-motion: reduce) { .ofimare-login * { transition: none !important; } }
@media print {
  body { color: #000; background: #fff; }
  .ofimare-welcome { display: none; }
}
