/* Embedded India Mail — brand layer over Roundcube Elastic skin.
   Ensures WCAG-friendly contrast in both light and dark modes,
   and keeps the left rail Compose ("New mail") button un-highlighted unless active/hovered. */
:root {
  --ei-primary: #007f5f;
  --ei-primary-hover: #00664c;
  --ei-primary-light: #6ee7b7;
  --ei-dark: #0d1715;
  --ei-soft: #e6f3ef;
  --ei-soft-border: #007f5f;
}

/* Left icon rail (#layout-menu) — light Fluent-style rail with Emerald accent */
html:not(.ei-skin-outlook) #layout-menu,
html:not(.ei-skin-outlook) .layout-menu,
html:not(.ei-skin-outlook) #layout-menu .popover-header,
html:not(.ei-skin-outlook) #layout-menu .special-buttons,
html:not(.ei-skin-outlook) #taskmenu .special-buttons,
html:not(.ei-skin-outlook) #layout-menu #logo {
  background-color: #f3f2f1 !important;
  color: #424242 !important;
}
html:not(.ei-skin-outlook) #layout-menu {
  border-right: 1px solid #e1dfdd !important;
}
html:not(.ei-skin-outlook) #taskmenu .special-buttons {
  border-top: 1px solid #e1dfdd !important;
}
html:not(.ei-skin-outlook) #layout-menu #taskmenu a,
html:not(.ei-skin-outlook) #layout-menu #taskmenu a:visited,
html:not(.ei-skin-outlook) #layout-menu .special-buttons a,
html:not(.ei-skin-outlook) #layout-menu .special-buttons a:not(:focus),
html:not(.ei-skin-outlook) #layout-menu a {
  border-radius: 8px !important;
  color: #424242 !important;
  background-color: transparent !important;
  box-shadow: none !important;
  border-bottom: 0 !important;
  position: relative;
}
html:not(.ei-skin-outlook) #layout-menu .popover-header a,
html:not(.ei-skin-outlook) #layout-menu .popover-header .button {
  color: #424242 !important;
}
html:not(.ei-skin-outlook) #layout-menu a:hover,
html:not(.ei-skin-outlook) #layout-menu a:focus,
html:not(.ei-skin-outlook) #layout-menu .special-buttons a:hover,
html:not(.ei-skin-outlook) #layout-menu .special-buttons a:focus {
  color: var(--ei-primary-hover) !important;
  background-color: rgba(0, 127, 95, 0.08) !important;
}
html:not(.ei-skin-outlook) #layout-menu a.selected,
html:not(.ei-skin-outlook) #layout-menu a.active,
html:not(.ei-skin-outlook) #layout-menu #taskmenu a.selected,
html:not(.ei-skin-outlook) #layout-menu #taskmenu a.active {
  color: var(--ei-primary-hover) !important;
  background-color: transparent !important;
  box-shadow: none !important;
  font-weight: 600;
}
html:not(.ei-skin-outlook) #layout-menu a.selected:hover,
html:not(.ei-skin-outlook) #layout-menu a.active:hover {
  background-color: rgba(0, 127, 95, 0.08) !important;
}
html:not(.ei-skin-outlook) #layout-menu a.selected::after,
html:not(.ei-skin-outlook) #layout-menu a.active::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 24px;
  width: 3.5px;
  border-radius: 0 999px 999px 0;
  background: var(--ei-primary);
}
html:not(.ei-skin-outlook) #layout-menu #taskmenu a.logout,
html:not(.ei-skin-outlook) #layout-menu #taskmenu a.logout:visited,
html:not(.ei-skin-outlook) #layout-menu #taskmenu a.logout:not(:focus) {
  color: #b91c1c !important;
  background-color: transparent !important;
}
html:not(.ei-skin-outlook) #layout-menu #taskmenu a.logout:hover,
html:not(.ei-skin-outlook) #layout-menu #taskmenu a.logout:focus {
  color: #991b1b !important;
  background-color: rgba(220, 38, 38, 0.1) !important;
}

/* Dark mode left rail for Default Emerald skin */
html.dark-mode:not(.ei-skin-outlook) #layout-menu,
html.dark-mode:not(.ei-skin-outlook) .layout-menu,
html.dark-mode:not(.ei-skin-outlook) #layout-menu .popover-header,
html.dark-mode:not(.ei-skin-outlook) #layout-menu .special-buttons,
html.dark-mode:not(.ei-skin-outlook) #taskmenu .special-buttons,
html.dark-mode:not(.ei-skin-outlook) #layout-menu #logo {
  background-color: #16201d !important;
  color: #e2ebe9 !important;
  border-color: #263832 !important;
}
html.dark-mode:not(.ei-skin-outlook) #layout-menu #taskmenu a,
html.dark-mode:not(.ei-skin-outlook) #layout-menu .special-buttons a,
html.dark-mode:not(.ei-skin-outlook) #layout-menu a,
html.dark-mode:not(.ei-skin-outlook) #layout-menu .popover-header a,
html.dark-mode:not(.ei-skin-outlook) #layout-menu .popover-header .button {
  color: #cbd5e1 !important;
}
html.dark-mode:not(.ei-skin-outlook) #layout-menu a:hover,
html.dark-mode:not(.ei-skin-outlook) #layout-menu a:focus {
  color: #ffffff !important;
  background-color: rgba(110, 231, 183, 0.12) !important;
}
html.dark-mode:not(.ei-skin-outlook) #layout-menu a.selected,
html.dark-mode:not(.ei-skin-outlook) #layout-menu a.active {
  color: var(--ei-primary-light) !important;
  background-color: transparent !important;
}
html.dark-mode:not(.ei-skin-outlook) #layout-menu a.selected::after,
html.dark-mode:not(.ei-skin-outlook) #layout-menu a.active::after {
  background: var(--ei-primary-light);
}
html.dark-mode:not(.ei-skin-outlook) #layout-menu #taskmenu a.logout,
html.dark-mode:not(.ei-skin-outlook) #layout-menu #taskmenu a.logout:visited {
  color: #fca5a5 !important;
}
html.dark-mode:not(.ei-skin-outlook) #layout-menu #taskmenu a.logout:hover,
html.dark-mode:not(.ei-skin-outlook) #layout-menu #taskmenu a.logout:focus {
  color: #ffffff !important;
  background-color: rgba(239, 68, 68, 0.28) !important;
}
/* Center Default Emerald rail buttons cleanly inside Elastic's 42px tablet rail */
@media screen and (min-width: 481px) and (max-width: 1024px) {
  html:not(.ei-skin-outlook) #layout-menu {
    position: relative;
  }
  html:not(.ei-skin-outlook) #layout-menu #taskmenu .special-buttons {
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    overflow: hidden;
  }
  html:not(.ei-skin-outlook) #layout-menu #taskmenu a,
  html:not(.ei-skin-outlook) #layout-menu #taskmenu .special-buttons a {
    width: 34px !important;
    min-width: 34px !important;
    margin: 2px auto !important;
    box-sizing: border-box !important;
  }
}
/* Floating compose/action FAB on phone layout */
.floating-action-buttons a.button,
.floating-action-buttons button.button {
  background-color: var(--ei-primary) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 18px rgba(0, 127, 95, 0.35) !important;
}
.floating-action-buttons a.button:hover,
.floating-action-buttons button.button:hover {
  background-color: var(--ei-primary-dark) !important;
}
#logo {
  max-height: 44px;
}

/* Dark mode message reading pane & compose editor body fallback (both skins) */
html.dark-mode .message-htmlpart,
html.dark-mode .message-part,
html.dark-mode .message-htmlpart > div.rcmBody {
  background-color: #111b18 !important;
  color: #e8e6e3 !important;
  border-color: #263832 !important;
}
html.dark-mode .message-partheaders {
  background-color: #182622 !important;
  border-color: #263832 !important;
  color: #e2ebe9 !important;
}
html.dark-mode textarea#composebody,
html.dark-mode div.tox .tox-edit-area__iframe {
  background-color: #111b18 !important;
  color: #f1f5f9 !important;
}

/* Primary form/modal actions (excluding the left rail Compose link) */
.btn-primary,
.btn.btn-primary,
button.btn-primary,
input.btn-primary,
.formbuttons .btn.mainaction,
.mainaction {
  background-color: var(--ei-primary) !important;
  border-color: var(--ei-primary) !important;
  color: #ffffff !important;
}
.btn-primary:hover,
.btn-primary:focus,
.mainaction:hover,
.mainaction:focus {
  background-color: var(--ei-primary-hover) !important;
  border-color: var(--ei-primary-hover) !important;
  color: #ffffff !important;
}

/* Links & form focus (light mode defaults) */
a,
a:visited,
.link {
  color: var(--ei-primary);
}
.toolbar a.button,
.header .toolbar a {
  color: #1e293b;
}
.header .toolbar a.selected,
.toolbar a.button.selected,
.toolbar a.button:hover {
  color: var(--ei-primary) !important;
}
.form-control:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: var(--ei-primary) !important;
  box-shadow: 0 0 0 0.2rem rgba(0, 127, 95, 0.22) !important;
}
.custom-control-input:checked ~ .custom-control-label::before,
.custom-switch .custom-control-input:checked ~ .custom-control-label::before {
  background-color: var(--ei-primary) !important;
  border-color: var(--ei-primary) !important;
}

/* Lists, folders, unread & selected rows (Light mode) */
.listing li.selected,
.listing li.selected > a,
.listing li.selected > div,
table.records-table tr.selected,
table.records-table tr.selected td,
table.messagelist tr.selected td {
  background-color: var(--ei-soft) !important;
  color: var(--ei-dark) !important;
}
.listing li.selected,
table.messagelist tr.selected td:first-child {
  border-left-color: var(--ei-primary) !important;
}
#folderlist-content li.selected > a,
#folderlist-content li.selected > div a {
  color: #005c44 !important;
  font-weight: 600;
}
table.messagelist tr.unread td.subject span.subject a,
table.messagelist tr.unread .fromto {
  color: var(--ei-dark) !important;
  font-weight: 600;
}
.listing li a.name {
  color: #13211e;
}
.unreadcount,
span.unreadcount {
  background-color: var(--ei-primary) !important;
  color: #ffffff !important;
}
.popupmenu li a.active:hover,
.popover .listing li a:hover {
  color: var(--ei-primary);
}

/* Login page */
body.task-login {
  background: radial-gradient(circle at top right, #e6f3ef 0%, #f4f7f6 58%, #eef3f1 100%) !important;
  color: var(--ei-dark);
}
body.task-login #layout {
  min-height: 100dvh;
}
body.task-login #layout-content {
  background: transparent !important;
  min-height: 100dvh;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 24px 16px;
}
body.task-login #logo {
  position: static !important;
  top: auto !important;
  display: block;
  max-height: 58px;
  width: auto;
  max-width: min(100%, 260px);
  margin: 0 auto !important;
}
#login-form {
  position: static !important;
  top: auto !important;
  width: 100% !important;
  max-width: 400px !important;
  margin: 0 auto !important;
  background: #ffffff;
  color: var(--ei-dark);
  border: 1px solid #d5e2df;
  border-radius: 18px;
  box-shadow: 0 14px 36px rgba(13, 23, 21, 0.08);
  padding: 32px 28px 24px !important;
}
#login-form tr.form-group.row {
  margin: 0 0 14px;
  width: 100%;
}
#login-form td.input.input-group {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  width: 100%;
  padding: 0;
}
#login-form .input-group-prepend .input-group-text {
  background-color: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
  min-width: 46px;
  min-height: 46px;
  justify-content: center;
  border-radius: 10px 0 0 10px;
}
#login-form input.form-control {
  min-height: 46px;
  background-color: #f8fafc;
  border-color: #cbd5e1;
  color: #0d1715;
  font-size: 0.9375rem;
  border-radius: 0 10px 10px 0;
}
#login-form input.form-control:not(:last-child) {
  border-radius: 0 !important;
  border-right: 0;
}
#login-form .input-group-append,
.ei-pass-wrap .input-group-append {
  display: flex;
}
#login-form .input-group-append .ei-pass-toggle {
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 0;
  color: #475569;
  min-width: 46px;
  min-height: 46px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 10px 10px 0;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}
#login-form .input-group-append .ei-pass-toggle:hover,
.ei-pass-wrap .ei-pass-toggle:hover {
  color: var(--ei-primary);
}
#login-form .input-group-append .ei-pass-toggle:focus-visible,
.ei-pass-wrap .ei-pass-toggle:focus-visible {
  outline: 2px solid var(--ei-primary);
  outline-offset: -2px;
}
.ei-pass-wrap {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  width: 100%;
}
.ei-pass-wrap > input.form-control {
  min-width: 0;
  flex: 1 1 auto;
}
.ei-pass-wrap .ei-pass-toggle {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 0 10px;
}
#login-form input.form-control:-webkit-autofill,
#login-form input.form-control:-webkit-autofill:hover,
#login-form input.form-control:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #f8fafc inset !important;
  -webkit-text-fill-color: #0d1715 !important;
  transition: background-color 5000s ease-in-out 0s;
}
#login-form .formbuttons {
  margin: 8px 0 0;
}
#rcmloginsubmit {
  width: 100%;
  min-height: 44px;
  border-radius: 10px !important;
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
#rcmloginsubmit::before {
  content: "\f2f6";
  font-family: "Icons";
  font-weight: 900;
  display: inline-block !important;
  font-style: normal;
  line-height: 1;
}
#login-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #e2ece9;
  text-align: center;
  font-size: 0 !important;
}
#login-footer a,
#login-footer > div {
  font-size: 0.8125rem !important;
}
#login-footer,
#login-footer a {
  color: #3a4c47 !important;
  font-weight: 500;
}
#login-footer a:hover {
  color: var(--ei-primary) !important;
  text-decoration: underline;
}
@media (max-width: 480px) {
  #login-form {
    padding: 24px 18px 20px !important;
    border-radius: 14px;
  }
}

/* Dark mode overrides — crisp contrast on dark surfaces */
html.dark-mode #layout-menu,
html.dark-mode .layout-menu,
html.dark-mode #layout-menu .popover-header,
html.dark-mode #layout-menu #logo {
  background-color: #08100e !important;
}
html.dark-mode a,
html.dark-mode a:visited,
html.dark-mode .link {
  color: var(--ei-primary-light);
}
html.dark-mode .toolbar a.button,
html.dark-mode .header .toolbar a {
  color: #e2e8f0;
}
html.dark-mode .header .toolbar a.selected,
html.dark-mode .toolbar a.button.selected,
html.dark-mode .toolbar a.button:hover {
  color: var(--ei-primary-light) !important;
}
html.dark-mode .listing li.selected,
html.dark-mode .listing li.selected > a,
html.dark-mode .listing li.selected > div,
html.dark-mode table.messagelist tr.selected td,
html.dark-mode table.records-table tr.selected,
html.dark-mode table.records-table tr.selected td {
  background-color: rgba(16, 185, 129, 0.2) !important;
  color: #f8fafc !important;
}
html.dark-mode #folderlist-content li.selected > a,
html.dark-mode #folderlist-content li.selected > div a,
html.dark-mode .listing li a.name,
html.dark-mode .listing li.selected > a {
  color: var(--ei-primary-light) !important;
}
html.dark-mode table.messagelist tr.unread td.subject span.subject a,
html.dark-mode table.messagelist tr.unread .fromto,
html.dark-mode table.messagelist tr td.subject span.subject a,
html.dark-mode table.messagelist tr .fromto {
  color: #f1f5f9 !important;
}
html.dark-mode table.messagelist tr:not(.unread) td.subject span.subject a,
html.dark-mode table.messagelist tr:not(.unread) .fromto {
  color: #cbd5e1 !important;
}
html.dark-mode .unreadcount,
html.dark-mode span.unreadcount {
  background-color: #059669 !important;
  color: #ffffff !important;
}
html.dark-mode body.task-login {
  background: radial-gradient(circle at top right, #122621 0%, #0d1715 62%) !important;
  color: #f1f5f9;
}
html.dark-mode body.task-login #logo {
  background: rgba(255, 255, 255, 0.96);
  padding: 10px 16px;
  border-radius: 14px;
  max-height: 78px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
html.dark-mode #login-form {
  background: #13211e;
  color: #f1f5f9;
  border-color: #243b36;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
}
html.dark-mode #login-form .input-group-text {
  background: #0d1715;
  border-color: #2d4a43;
  color: #a7c0ba;
}
html.dark-mode #login-form input.form-control {
  background: #0d1715;
  color: #f8fafc;
  border-color: #2d4a43;
}
html.dark-mode #login-form .input-group-append .ei-pass-toggle,
html.dark-mode .ei-pass-wrap .ei-pass-toggle {
  background: #0d1715;
  border-color: #2d4a43;
  color: #a7c0ba;
}
html.dark-mode #login-form .input-group-append .ei-pass-toggle:hover,
html.dark-mode .ei-pass-wrap .ei-pass-toggle:hover {
  color: var(--ei-primary-light);
}
html.dark-mode #login-form input.form-control:-webkit-autofill,
html.dark-mode #login-form input.form-control:-webkit-autofill:hover,
html.dark-mode #login-form input.form-control:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #0d1715 inset !important;
  -webkit-text-fill-color: #f8fafc !important;
}
html.dark-mode #login-footer {
  border-top-color: #243b36;
}
html.dark-mode #login-footer,
html.dark-mode #login-footer a {
  color: #a7c0ba !important;
}

/* Hide upstream "About" entries wherever the base skin places them */
a.about,
li.about,
#settings-menu .about,
#rcmrowabout {
  display: none !important;
}
