/* BWP Webmail. Loaded after the inherited Elastic styles. */
:root {
  --bwp-plum: #30203f;
  --bwp-violet: #7735bd;
  --bwp-cyan: #08c9df;
  --bwp-pink: #f653ae;
  --bwp-surface: #ffffff;
  --bwp-soft: #fdfbff;
  --bwp-text: #30203f;
  --bwp-muted: #6f617d;
  --bwp-border: #e7dfef;
  --bwp-selected: #eee4f7;
  --bwp-selected-text: #4c246d;
  --bwp-gradient: linear-gradient(105deg, #9331d6 0%, #bd30c1 52%, #d3319d 100%);
}
html.dark-mode {
  --bwp-surface: #241b2f;
  --bwp-soft: #2c2238;
  --bwp-text: #f2eaf9;
  --bwp-muted: #c4b4d3;
  --bwp-border: #4c3b5f;
  --bwp-selected: #503466;
  --bwp-selected-text: #fff;
}
html:root body { font-family: Roboto, Arial, sans-serif; color: var(--bwp-text); }
html:root body #logo { opacity: 1; }
html.dark-mode body #layout-menu #taskmenu .special-buttons a:not(:focus) { background: transparent; }
html.dark-mode body #layout-menu #taskmenu .special-buttons a:hover { background: #68467f80; }
html:root body #layout-menu {
  background: linear-gradient(#231c39 0%, #30203ff5 58%, #30203fba 100%), url('../images/mountains.webp') center bottom / auto 100% no-repeat;
  color: #f6effc;
}
html:root body #layout-menu .popover-header { background: transparent !important; }
html:root body #layout-menu .popover-header #logo { object-fit: contain; }
html:root body #layout-menu .bwp-inbox-link { display: inline-flex !important; align-items: center; justify-content: center; vertical-align: middle; max-width: 100%; min-width: 0; border-radius: 6px; cursor: pointer; }
html:root body #layout-menu .bwp-inbox-link:hover { background: #ffffff0d; }
html:root body #taskmenu a { color: #f6effc; }
html:root body #taskmenu a:hover,
html:root body #taskmenu a:focus-visible,
html:root body #taskmenu a.selected { color: #fff; background-color: #68467f80; }
html:root body #taskmenu .special-buttons { background: transparent; }
html:root body #taskmenu a.logout { color: #ffb0cc !important; }
html:root body #taskmenu .action-buttons a.compose {
  color: #fff; background: var(--bwp-gradient); border-radius: 9px;
}
html:root body #taskmenu .action-buttons a.compose:hover { filter: brightness(1.12); }
html:root body .floating-action-buttons a.button.compose { background: var(--bwp-gradient); color: #fff; }
html:root body #taskmenu .action-buttons a.compose .inner { font-weight: 600; }
html:root body #layout-sidebar,
html:root body #layout-list { background-color: var(--bwp-soft); border-color: var(--bwp-border); }
html:root body #layout-content { background-color: var(--bwp-surface); }
html:root body #layout > div > .header,
html:root body #layout > div > .footer { background-color: var(--bwp-surface); border-color: var(--bwp-border); color: var(--bwp-text); }
html:root body .listing li.selected > a,
html:root body .listing tr.selected td,
html:root body .listing tr.focused > td,
html:root body .listing li > a:focus { background-color: var(--bwp-selected); color: var(--bwp-selected-text); }
html:root body .listing li > a:hover { background-color: var(--bwp-selected); color: var(--bwp-selected-text); }
html:root body .searchbar { background-color: var(--bwp-soft); border-color: var(--bwp-border); }
html:root body .searchbar input { background-color: var(--bwp-soft); color: var(--bwp-text); }
html:root body .listing td { border-color: var(--bwp-border); }
html:root body .messagelist td.subject span.subject a { color: var(--bwp-text); }
html:root body .messagelist td.subject span.fromto,
html:root body .messagelist td.subject span.date { color: var(--bwp-muted); }
html:root body .messagelist tr.unread td.flags span.unread::before,
html:root body .messagelist tr.unread .unread::before { color: #00b8d4; }
/* Keep long mailboxes scrollable without the heavy native scrollbar track. */
html:root body #folderlist-content,
html:root body #messagelist-content,
html:root body #taskmenu { scrollbar-width: thin; scrollbar-color: #ad99c2 transparent; }
html:root body #folderlist-content { scrollbar-color: #9075a7 transparent; }
html:root body #folderlist-content::-webkit-scrollbar,
html:root body #messagelist-content::-webkit-scrollbar,
html:root body #taskmenu::-webkit-scrollbar { width: 6px; height: 6px; }
html:root body #folderlist-content::-webkit-scrollbar-track,
html:root body #messagelist-content::-webkit-scrollbar-track,
html:root body #taskmenu::-webkit-scrollbar-track { background: transparent; }
html:root body #folderlist-content::-webkit-scrollbar-thumb,
html:root body #messagelist-content::-webkit-scrollbar-thumb,
html:root body #taskmenu::-webkit-scrollbar-thumb { background: #ad99c2; border-radius: 12px; border: 1px solid transparent; background-clip: padding-box; }
html:root body #folderlist-content::-webkit-scrollbar-thumb { background-color: #9075a7; }
html.dark-mode body #messagelist-content { scrollbar-color: #816695 transparent; }
html:root body #messagelist-content { overscroll-behavior: contain; }
html:root body #messagelist td.subject { min-width: 0; padding-top: 11px; padding-bottom: 11px; }
html:root body #messagelist td.subject > .fromto { font-size: 15px; line-height: 1.6; color: var(--bwp-text); font-weight: 500; }
html:root body #messagelist tr.unread td.subject > .fromto { font-weight: 700; }
html:root body #messagelist td.subject > .date,
html:root body #messagelist td.subject > .size { font-size: 12px; line-height: 2; color: var(--bwp-muted); }
html:root body #messagelist td.subject > .subject { font-size: 15px; line-height: 1.75; font-weight: 400; }
html:root body #messagelist tr.unread td.subject > .subject { font-weight: 600; }
html:root body #messagelist td.flags { padding-top: 10px; }
html:root body #messagelist tr:not(.selected):not(.focused) td { background-color: var(--bwp-surface); }
html:root body #messagelist tr:hover:not(.selected):not(.focused) td { background-color: var(--bwp-soft); }
html:root body .btn-primary,
html:root body button.mainaction,
html:root body input.mainaction { background: var(--bwp-gradient); border-color: #8038b8; color: #fff; }
html:root body .btn-primary:hover,
html:root body button.mainaction:hover { filter: brightness(1.1); color: #fff; }
html:root body input.form-control:focus,
html:root body select.form-control:focus,
html:root body textarea.form-control:focus { border-color: #8c4cc8; box-shadow: 0 0 0 3px #8c4cc82e; }
html:root body a:focus-visible,
html:root body button:focus-visible { outline: 3px solid var(--bwp-cyan) !important; outline-offset: -3px; }

/* Desktop: keep Elastic's real task navigation and folder tree, arrange them
   as one branded sidebar. Smaller screens retain Elastic's existing navigation. */
@media (min-width: 1100px) and (min-height: 480px) {
  html:root body #layout-menu { width: 220px; min-width: 220px; display: flex; flex-direction: column; }
  html:root body #layout-menu .popover-header { height: 160px; min-height: 160px; line-height: 1; padding: 16px 26px !important; }
  html:root body #layout-menu .popover-header #logo { max-width: 100%; width: 220px; max-height: 128px; padding: 0; }
  html:root body #taskmenu { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 8px 14px 12px; text-align: left; }
  html:root body #taskmenu a { width: 100%; max-width: none; min-height: 40px; height: 40px; padding: 0 15px; line-height: 40px; text-align: left; border-radius: 7px; }
  html:root body #taskmenu a::before { float: left !important; width: 20px !important; height: 40px !important; line-height: 40px !important; margin-right: 12px !important; font-size: 18px; }
  html:root body #taskmenu a .inner { display: inline; padding: 0; font-size: 15px; }
  html:root body #taskmenu .action-buttons { display: block; padding-bottom: 16px; }
  html:root body #taskmenu .action-buttons a.compose { height: 50px; line-height: 50px; padding: 0 19px; }
  html:root body #taskmenu .action-buttons a.compose .inner { font-size: 17px; font-weight: 600; }
  html:root body #taskmenu .action-buttons a.compose::before { height: 50px !important; line-height: 50px !important; font-size: 21px; }
  html:root body #taskmenu .bwp-secondary-nav { margin-top: auto; padding-top: 12px; border-top: 1px solid #ffffff24; }
  html:root body #taskmenu .special-buttons { position: static; display: block; width: 100%; margin-top: 8px; padding-top: 8px; border-top: 1px solid #ffffff24; }
  html.bwp-merged body.task-mail.action-none #layout {
    display: grid; grid-template-columns: clamp(235px, 19vw, 320px) clamp(340px, 32vw, 535px) minmax(0, 1fr);
    grid-template-rows: var(--bwp-folder-top, 212px) minmax(80px, 1fr) var(--bwp-nav-height, 245px);
  }
  html.bwp-merged body.task-mail.action-none #layout-menu { grid-column: 1; grid-row: 1 / 4; width: auto; min-width: 0; }
  html.bwp-merged body.task-mail.action-none #layout-sidebar {
    grid-column: 1; grid-row: 2; z-index: 1; width: auto !important; min-width: 0 !important;
    max-width: none !important; display: flex !important; min-height: 0; background: transparent; color: #f6effc; border: 0;
  }
  html.bwp-merged body.task-mail.action-none #layout-sidebar > .header,
  html.bwp-merged body.task-mail.action-none #layout-sidebar > .footer { color: #f6effc; background: transparent; border-color: #ffffff24; }
  html.bwp-merged body.task-mail.action-none #layout-sidebar > .header { height: 40px; min-height: 40px; line-height: 40px; }
  html.bwp-merged body.task-mail.action-none #layout-sidebar .header-title { font-size: 12px; }
  html.bwp-merged body.task-mail.action-none #layout-sidebar a,
  html.bwp-merged body.task-mail.action-none #layout-sidebar .header a.button { color: #f6effc; }
  html.bwp-merged body.task-mail.action-none #folderlist-content { padding: 4px 14px 12px; }
  html.bwp-merged body.task-mail.action-none #mailboxlist li { border: 0; }
  html.bwp-merged body.task-mail.action-none #mailboxlist li > a { border-radius: 7px; margin-bottom: 3px; background: transparent; color: #f6effc; font-size: 15px; line-height: 39px; }
  html.bwp-merged body.task-mail.action-none #mailboxlist .treetoggle { line-height: 39px; }
  html.bwp-merged body.task-mail.action-none #mailboxlist li.inbox > a::before { content: '\f0e0'; }
  html.bwp-merged body.task-mail.action-none #mailboxlist li.junk > a::before { content: '\f3ed'; }
  html.bwp-merged body.task-mail.action-none #mailboxlist li.drafts > a::before { content: '\f15c'; }
  html.bwp-merged body.task-mail.action-none #mailboxlist li.selected > a { background: #744e8b80; box-shadow: inset 4px 0 var(--bwp-cyan); color: #fff; }
  html.bwp-merged body.task-mail.action-none #mailboxlist li > a:hover { background: #744e8b60; }
  html.bwp-merged body.task-mail.action-none #mailboxlist .unreadcount { background: #f4eafa; color: #653296; }
  html.bwp-merged body.task-mail.action-none #layout-list { grid-column: 2; grid-row: 1 / 4; display: flex !important; min-width: 0 !important; min-height: 0; max-width: none !important; width: auto !important; }
  html.bwp-merged body.task-mail.action-none #layout-content { grid-column: 3; grid-row: 1 / 4; display: flex !important; min-width: 0; min-height: 0; }
  html.bwp-merged body.task-mail.action-none #layout-list .searchbar { margin: 13px 18px; width: auto; border: 0; border-radius: 12px; background: var(--bwp-selected); }
  html.bwp-merged body.task-mail.action-none #layout-list .searchbar input { background: transparent; padding-left: 36px; }
  html.bwp-merged body.task-mail.action-none #layout-list .searchbar a { border-radius: 8px; }
  html.bwp-merged body.task-mail.action-none .column-resizer { display: none; }
  html.bwp-merged body.task-mail.action-none #taskmenu > .bwp-secondary-nav > a.mail { display: none; }
}
@media (min-width: 1100px) and (min-height: 480px) and (max-height: 799px) {
  html:root body #layout-menu .popover-header { height: 108px; min-height: 108px; padding: 10px 24px !important; }
  html:root body #layout-menu .popover-header #logo { width: 168px; max-height: 88px; }
  html:root body #taskmenu { padding-top: 4px; padding-bottom: 8px; }
  html:root body #taskmenu a { height: 32px; min-height: 32px; line-height: 32px; }
  html:root body #taskmenu a::before { height: 32px !important; line-height: 32px !important; }
  html:root body #taskmenu .action-buttons { padding-bottom: 8px; }
  html:root body #taskmenu .action-buttons a.compose { height: 44px; line-height: 44px; }
  html:root body #taskmenu .action-buttons a.compose::before { height: 44px !important; line-height: 44px !important; }
  html:root body #taskmenu .bwp-secondary-nav { padding-top: 8px; }
  html:root body #taskmenu .special-buttons { margin-top: 4px; padding-top: 4px; }
}

/* Real Roundcube login form: native form, CSRF fields, hooks and SSO retained. */
html:root body.task-login { overflow: auto; background: #30203f; }
html:root body.task-login #layout { height: auto; min-height: 100vh; display: block; }
html:root body.task-login #layout-content.bwp-login {
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  min-height: 100vh; width: 100%; padding: 42px 20px 32px;
  background: linear-gradient(#30203fbf, #30203f75), url('../images/mountains.webp') center bottom / cover no-repeat;
}
html:root body.task-login .bwp-login-brand { width: 230px; margin: 0 auto 28px; }
html:root body.task-login #logo { position: static; top: auto; max-height: none; max-width: 100%; width: 100%; padding: 0; }
html:root body.task-login .bwp-login-panel { width: 100%; max-width: 420px; padding: 32px; background: var(--bwp-surface); color: var(--bwp-text); border: 1px solid var(--bwp-border); border-radius: 16px; box-shadow: 0 18px 65px #170b2d35; text-align: left; }
html:root body.task-login #bwp-login-heading { margin: 0 0 10px; text-align: center; font-size: 23px; font-weight: 700; line-height: 1.3; }
html:root body.task-login .bwp-login-intro { font-size: 13px; line-height: 1.6; text-align: center; color: var(--bwp-muted); margin-bottom: 26px; }
html:root body.task-login #login-form { width: 100%; max-width: none; position: static; top: auto; margin: 0; }
html:root body.task-login #login-form table { width: 100%; }
html:root body.task-login #login-form td { padding: 5px 0; }
html:root body.task-login #login-form td.title { display: block !important; padding-bottom: 6px; font-size: 13px; color: var(--bwp-text); }
html:root body.task-login #login-form .input-group-prepend { display: none; }
html:root body.task-login #login-form .input-group { display: block; }
html:root body.task-login #login-form input.form-control { width: 100%; min-height: 45px; font-size: 16px; background: var(--bwp-soft); color: var(--bwp-text); border: 1px solid var(--bwp-border); border-radius: 8px; }
html:root body.task-login #rcmloginsubmit { width: 100%; min-height: 46px; border-radius: 8px; margin-top: 12px; }
html:root body.task-login #login-footer { margin-top: 20px; text-align: center; color: var(--bwp-muted); font-size: 12px; }
html:root body.task-login #login-footer a { color: var(--bwp-selected-text); text-decoration: underline; text-underline-offset: 3px; }
html:root body.task-login .bwp-login-credit { text-align: center; color: #fff; margin-top: 24px; font-size: 12px; text-shadow: 0 1px 4px #30203f; }
html:root body.task-login .bwp-login-credit a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
html:root body.task-login #login-addon { position: static; margin: 16px auto !important; max-height: none; }
html:root body.task-login #messagestack { z-index: 100000; }
html:root body.task-login .noscriptwarning { position: relative; color: #fff; background: #30203f; padding: 16px; margin: 0; text-align: center; }
@media (max-width: 1099px), (max-height: 479px) {
  html:root body #taskmenu .bwp-secondary-nav { display: contents; }
}
@media (max-width: 480px) {
  html:root body #layout-menu .popover-header #logo { width: 140px; max-height: 58px; }
  html:root body #layout-menu #taskmenu a { color: #f6effc; }
  html:root body.task-login #layout-content.bwp-login { padding: 26px 16px; }
  html:root body.task-login .bwp-login-brand { width: 190px; margin-bottom: 22px; }
  html:root body.task-login .bwp-login-panel { padding: 26px 22px; }
  html:root body.task-login #bwp-login-heading { font-size: 21px; }
}
@media print {
  html:root body { color: #000; background: #fff; }
  html:root body #layout-menu, html:root body .bwp-login-credit { display: none !important; }
}
