/* STRIX whitelabel overlay for Roundcube Elastic.
   Palette matches stricklandai.com: navy #0F172A, blue #3B82F6, green #10B981. */

:root {
  --strix-navy: #0F172A;
  --strix-navy-mid: #1E293B;
  --strix-blue: #3B82F6;
  --strix-blue-hover: #2563EB;
  --strix-blue-deep: #1D4ED8;
  --strix-blue-soft: #93C5FD;
  --strix-blue-tint: #DBEAFE;
  --strix-green: #10B981;
  --strix-bg: #F8FAFC;
  --strix-text: #0F172A;
  --strix-muted: #64748B;
  --strix-white: #F8FAFC;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Screen-reader heading. Elastic hides .voice; keep a local fallback. */
.voice {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Phone / iOS: keep fields at 16px so the viewport does not zoom on focus */
html.layout-phone input,
html.layout-phone select,
html.layout-phone textarea,
html.touch input,
html.touch select,
html.touch textarea {
  font-size: 16px !important;
}

html.layout-phone #layout,
html.layout-small #layout {
  min-width: 0 !important;
}

/* --- Global chrome: swap Elastic cyan for STRIX blue --- */
a,
a:visited,
.listing tbody tr > td.selection,
#taskmenu .action-buttons a,
html.dark-mode a,
html.dark-mode a:visited {
  color: var(--strix-blue);
}

a:hover,
a:focus,
#taskmenu .action-buttons a:hover {
  color: var(--strix-blue-hover);
}

.btn-primary,
.btn-primary.disabled,
.btn-primary:disabled,
.ui-widget-content .btn-primary,
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button.btn-primary {
  background: var(--strix-blue) !important;
  border-color: var(--strix-blue) !important;
  color: #fff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active {
  background: var(--strix-blue-hover) !important;
  border-color: var(--strix-blue-deep) !important;
}

.form-control:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
  border-color: var(--strix-blue) !important;
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.28) !important;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked,
.custom-control-input:checked ~ .custom-control-label::before,
.form-check-input:checked {
  background-color: var(--strix-blue) !important;
  border-color: var(--strix-blue) !important;
}

.listing li.selected,
.listing tr.selected,
.listing tbody tr.selected > td,
#mailboxlist li.selected > a,
#mailboxlist li.selected,
.folderlist li.selected,
.messagelist tr.selected td {
  background-color: var(--strix-blue-tint) !important;
}

.listing li.selected > a,
.folderlist li.selected > a {
  color: var(--strix-navy) !important;
}

.badge,
.unreadcount,
.count,
#mailboxlist span.unreadcount {
  background-color: var(--strix-blue) !important;
  color: #fff !important;
}

.menu.toolbar a.selected,
.menu.toolbar a.selected:hover,
.pagenav a.selected {
  background-color: rgba(59, 130, 246, 0.16);
}

.ui-state-active,
.ui-widget-header,
.ui-tabs .ui-tabs-nav li.ui-tabs-active,
.ui-datepicker .ui-datepicker-current-day a,
.ui-datepicker td .ui-state-active {
  background: var(--strix-blue) !important;
  border-color: var(--strix-blue) !important;
  color: #fff !important;
}

.ui-state-highlight,
.ui-datepicker td .ui-state-highlight {
  background: var(--strix-blue-tint) !important;
  border-color: var(--strix-blue-soft) !important;
  color: var(--strix-navy) !important;
}

/* --- Left task rail --- */
#layout-menu,
#layout-menu.popover,
#taskmenu {
  background-color: var(--strix-navy) !important;
}

@media screen and (min-width: 481px) {
  #layout-menu .popover-header {
    background-color: var(--strix-navy) !important;
  }
}

#taskmenu a,
#taskmenu a.selected,
#taskmenu a:hover,
#taskmenu a.selected:hover {
  color: var(--strix-white) !important;
}

#taskmenu a.selected,
#taskmenu a:hover {
  background-color: var(--strix-navy-mid) !important;
}

#taskmenu .action-buttons a,
#taskmenu .action-buttons a:hover {
  color: var(--strix-blue) !important;
}

#taskmenu a.logout,
#taskmenu a.logout:hover {
  color: #F87171 !important;
}

#layout > div > .header,
#layout-list > .header,
#layout-content > .header,
#layout-sidebar > .header,
.searchbar {
  background: var(--strix-bg);
}

/* --- Login --- */
html:has(body.task-login),
body.task-login {
  background: var(--strix-navy) !important;
  color: var(--strix-white);
  min-height: 100%;
}

body.task-login,
body.task-login #layout {
  overflow: auto !important;
}

body.task-login #layout,
body.task-login #layout-content {
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(59, 130, 246, 0.28), transparent 60%),
    var(--strix-navy) !important;
  color: var(--strix-white);
}

body.task-login #layout {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  min-height: 100vh;
  width: 100%;
  padding: max(20px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  box-sizing: border-box;
}

body.task-login #layout-content {
  position: static;
  width: min(100%, 720px);
  max-width: 720px;
  margin: 0 auto;
  padding: 0;
  overflow: visible;
}

body.task-login #layout-menu,
body.task-error-login #layout #layout-menu {
  display: none !important;
}

#strix-brand {
  position: static;
  top: auto;
  margin: 0 auto 1.75rem;
  text-align: center;
  width: 100%;
}

body.task-login #logo {
  position: static !important;
  top: auto !important;
  display: block;
  margin: 0 auto 0.35rem;
  width: min(100%, 720px) !important;
  height: auto !important;
  max-width: 720px !important;
  max-height: none !important;
  border-radius: 0;
  box-shadow: none;
}

.strix-tagline {
  margin: 0.15rem 0 0;
  color: #00B2FF;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.42em;
  text-transform: uppercase;
}

#login-form {
  position: static !important;
  top: auto !important;
  width: 100% !important;
  max-width: 420px !important;
  margin: 0 auto;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  padding: 1.25rem 1.1rem 1rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  box-sizing: border-box;
}

#login-form table,
#login-form tbody,
#login-form tr,
#login-form td.input {
  display: block;
  width: 100%;
}

#login-form .form-group {
  margin-bottom: 0.75rem;
}

#login-form .input-group,
#login-form .input-group.input-group-lg {
  display: flex;
  width: 100%;
  align-items: stretch;
}

#login-form td.title,
#login-form label,
body.task-login #login-form .input-group-text {
  color: var(--strix-blue-soft) !important;
}

body.task-login .form-control,
body.task-login input.form-control,
body.task-login input[type="text"],
body.task-login input[type="password"],
body.task-login .input-group-text,
body.task-login .input-group-prepend,
body.task-login .input-group-append,
body.task-login .input-group > .form-control {
  background: var(--strix-navy-mid) !important;
  border-color: #334155 !important;
  color: #F8FAFC !important;
}

body.task-login input[type="text"],
body.task-login input[type="password"],
body.task-login .form-control {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font-size: 16px !important;
  line-height: 1.25;
  box-sizing: border-box;
  border-radius: 0 10px 10px 0;
  border-width: 1px;
  border-style: solid;
}

body.task-login .input-group-prepend,
body.task-login .input-group-text {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 48px;
  box-sizing: border-box;
  border-radius: 10px 0 0 10px;
}

body.task-login .input-group-text {
  color: var(--strix-blue-soft) !important;
}

body.task-login .form-control::placeholder {
  color: #94A3B8;
  opacity: 1;
}

#login-footer,
#login-footer > div {
  background: transparent !important;
  color: #94A3B8 !important;
  text-align: center;
  margin-top: 0.85rem;
}

#login-footer a {
  color: var(--strix-blue-soft);
}

body.task-login #rcmloginsubmit,
body.task-login .formbuttons .btn {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 0.35rem;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 0;
  border-radius: 10px;
  box-sizing: border-box;
}

html.dark-mode body.task-login #logo {
  opacity: 1;
}

html.dark-mode body {
  background-color: var(--strix-navy) !important;
  color: #E2E8F0;
}

html.dark-mode #layout-list,
html.dark-mode #layout-content,
html.dark-mode #layout-sidebar,
html.dark-mode #layout > div > .header,
html.dark-mode #layout > div > .footer {
  background-color: #111827 !important;
  border-color: #1E293B !important;
}

html.dark-mode .listing li.selected,
html.dark-mode .listing tr.selected,
html.dark-mode .listing tbody tr.selected > td,
html.dark-mode #mailboxlist li.selected,
html.dark-mode .messagelist tr.selected td {
  background-color: rgba(59, 130, 246, 0.22) !important;
}

html.dark-mode .btn-primary {
  background: var(--strix-blue) !important;
  border-color: var(--strix-blue) !important;
}

html.dark-mode a {
  color: var(--strix-blue-soft);
}

.quota .bar,
.quota .value {
  background-color: var(--strix-blue) !important;
}

.success,
#messagestack .notice.success {
  background-color: var(--strix-green) !important;
}
