/* CuzBro Comms — Roundcube 1.7.x skin overlay on Elastic */

:root {
  --cb-blue: #4a8cff;
  --cb-cyan: #72d9ff;
  --cb-orange: #ff9d1c;
  --cb-purple: #7c4dff;
  --cb-green: #8ff0b1;
  --cb-bg: #020710;
  --cb-panel: rgba(7, 16, 34, .88);
  --cb-panel-strong: rgba(3, 10, 22, .96);
  --cb-line: rgba(255, 255, 255, .16);
  --cb-text: #f5f8ff;
  --cb-muted: #9fb3da;
  --cb-shadow: 0 18px 48px rgba(0, 0, 0, .42);
}

html, body { min-height: 100%; }
body {
  color: var(--cb-text);
  background:
    radial-gradient(circle at 12% -8%, rgba(74, 140, 255, .18), transparent 28rem),
    radial-gradient(circle at 92% 2%, rgba(255, 157, 28, .10), transparent 24rem),
    linear-gradient(180deg, #020710 0%, #030a16 52%, #020710 100%);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .36;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.7) 0 1px, transparent 1.4px),
    radial-gradient(circle, rgba(114,217,255,.6) 0 1px, transparent 1.4px);
  background-size: 83px 83px, 131px 131px;
  background-position: 10px 20px, 43px 67px;
}

/* Small site-matching three-mode selector */
.cuzbro-theme-toggle {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 10000;
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--cb-line);
  border-radius: 999px;
  background: rgba(5, 12, 25, .88);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.025), 0 10px 26px rgba(0,0,0,.28);
  backdrop-filter: blur(14px);
}
.cuzbro-theme-toggle button {
  height: 31px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  color: rgba(220, 231, 247, .64);
  background: transparent;
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.cuzbro-theme-toggle button:hover { color: #fff; transform: translateY(-1px); }
.cuzbro-theme-toggle button.active {
  color: #fff;
  background: rgba(74,140,255,.20);
  box-shadow: inset 0 0 0 1px rgba(114,217,255,.28), 0 0 16px rgba(74,140,255,.16);
}

/* Elastic chrome */
#layout-sidebar,
#layout-list,
#layout-content,
#layout-menu,
#layout > div,
.popover,
.modal-content,
.menu,
.popupmenu,
.ui-dialog,
.listbox,
.boxcontent,
.boxfooter {
  border-color: var(--cb-line) !important;
}
#layout-menu,
#layout-sidebar,
#layout-list {
  background: rgba(4, 11, 24, .88) !important;
  backdrop-filter: blur(18px);
}
#layout-content {
  background: rgba(2, 7, 16, .72) !important;
}
#layout-menu .popover-header,
.header,
.boxheader,
.content-title,
.listing li.selected,
.listing tbody tr.selected td {
  border-color: var(--cb-line) !important;
}

/* Navigation / icons */
#layout-menu .special-buttons a,
#layout-menu .popover-header,
#layout-menu a,
.toolbar a,
.menu a,
.popupmenu a { transition: color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease; }
#layout-menu a:hover,
.toolbar a:hover,
.menu a:hover,
.popupmenu a:hover {
  color: #fff !important;
  background: rgba(74,140,255,.12) !important;
}
#layout-menu .selected > a,
#layout-menu a.selected,
.listing li.selected,
.listing tbody tr.selected td {
  background: rgba(74,140,255,.16) !important;
  box-shadow: inset 3px 0 0 var(--cb-orange);
}

/* Message list */
.listing li,
.listing tbody td {
  border-color: rgba(255,255,255,.075) !important;
}
.listing li:hover,
.listing tbody tr:hover td {
  background: rgba(114,217,255,.055) !important;
}
.message.unread,
.listing .unread td,
.listing li.unread {
  background: rgba(74,140,255,.075) !important;
}
.message.unread .subject,
.listing .unread .subject,
.listing li.unread .subject { color: #fff !important; font-weight: 800; }

/* Forms */
.form-control,
.custom-select,
textarea,
input[type="text"],
input[type="password"],
input[type="email"],
select {
  color: #eef5ff !important;
  background: rgba(2, 7, 16, .78) !important;
  border-color: rgba(114,217,255,.18) !important;
}
.form-control:focus,
.custom-select:focus,
textarea:focus,
input:focus,
select:focus {
  border-color: rgba(114,217,255,.62) !important;
  box-shadow: 0 0 0 .2rem rgba(74,140,255,.14) !important;
}

/* Buttons */
.btn-primary,
button.btn-primary,
input.btn-primary {
  color: #fff !important;
  border-color: rgba(114,217,255,.42) !important;
  background: linear-gradient(180deg, rgba(74,140,255,.96), rgba(50,101,207,.96)) !important;
  box-shadow: 0 8px 22px rgba(74,140,255,.18);
}
.btn-primary:hover,
button.btn-primary:hover,
input.btn-primary:hover {
  border-color: rgba(255,157,28,.72) !important;
  box-shadow: 0 10px 26px rgba(255,157,28,.18) !important;
  transform: translateY(-1px);
}
.btn-secondary,
.btn-light {
  color: #dce7f9 !important;
  border-color: var(--cb-line) !important;
  background: rgba(7,16,34,.78) !important;
}

/* Headers / labels */
h1, h2, h3, h4, h5, h6, strong { color: #fff; }
a { color: var(--cb-cyan); }
.text-muted, .hint, .form-text { color: var(--cb-muted) !important; }

/* Compose and message panels */
#compose-content,
#message-content,
.message-part,
.messagelist,
.contactlist,
.settingsbox,
.boxcontent,
.card,
.modal-content,
.ui-dialog {
  background-color: rgba(7,16,34,.84) !important;
}

/* Login */
body.task-login { overflow: auto; }
body.task-login #layout { min-height: 100vh; }
.cuzbro-login {
  min-height: 100vh !important;
  display: grid !important;
  place-items: center;
  padding: 78px 20px !important;
  background: transparent !important;
}
.cuzbro-login-shell {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(7,16,34,.88), rgba(3,10,22,.94));
  box-shadow: 0 0 70px rgba(74,140,255,.16), var(--cb-shadow);
  backdrop-filter: blur(18px);
}
.cuzbro-login-brand {
  min-height: 470px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 54px;
  border-right: 1px solid var(--cb-line);
  background:
    radial-gradient(circle at 80% 16%, rgba(255,157,28,.13), transparent 15rem),
    radial-gradient(circle at 10% 78%, rgba(74,140,255,.17), transparent 18rem);
}
.cuzbro-login-brand #logo {
  width: min(290px, 86%);
  max-height: none;
  margin: 0 0 34px;
  filter: drop-shadow(0 0 18px rgba(74,140,255,.35)) drop-shadow(0 0 18px rgba(255,157,28,.22));
}
.cuzbro-kicker,
.cuzbro-form-label {
  color: #8ab5ff;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .28em;
  text-transform: uppercase;
}
.cuzbro-login-brand h2 {
  margin: 12px 0 9px;
  font-size: clamp(2rem, 5vw, 3.55rem);
  line-height: .95;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--cb-blue), #8a74ff, var(--cb-orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cuzbro-login-brand p { color: #b8c5db; font-size: 1rem; letter-spacing: .08em; text-transform: uppercase; }
.cuzbro-login-form {
  align-self: stretch;
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  margin: 0 !important;
  padding: 54px !important;
  background: rgba(2,7,16,.26);
}
.cuzbro-login-form .cuzbro-form-label { margin-bottom: 20px; color: var(--cb-orange); }
.cuzbro-login-form .form-group { margin-bottom: 17px; }
.cuzbro-login-form .form-control { min-height: 48px; border-radius: 12px; }
.cuzbro-login-form .btn { min-height: 48px; border-radius: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.cuzbro-login-form #login-footer { margin-top: 24px; color: var(--cb-muted); font-size: .75rem; text-align: center; }

/* LIGHT // DAY OPERATIONS */
html[data-theme="light"] {
  --cb-blue: #245fca;
  --cb-cyan: #087ea4;
  --cb-orange: #c76200;
  --cb-purple: #6543d8;
  --cb-green: #147d42;
  --cb-bg: #edf3fa;
  --cb-panel: rgba(255,255,255,.88);
  --cb-panel-strong: rgba(247,250,255,.96);
  --cb-line: rgba(18,42,72,.18);
  --cb-text: #13243b;
  --cb-muted: #526984;
  --cb-shadow: 0 18px 48px rgba(38,67,103,.12);
}
html[data-theme="light"] body {
  color: #13243b;
  background:
    radial-gradient(circle at 14% 6%, rgba(74,140,255,.14), transparent 26rem),
    radial-gradient(circle at 88% 14%, rgba(255,157,28,.10), transparent 24rem),
    linear-gradient(180deg, #f7faff 0%, #edf3fa 48%, #e7eef7 100%);
}
html[data-theme="light"] body::before { opacity: .10; filter: invert(1); }
html[data-theme="light"] #layout-menu,
html[data-theme="light"] #layout-sidebar,
html[data-theme="light"] #layout-list,
html[data-theme="light"] #layout-content,
html[data-theme="light"] #compose-content,
html[data-theme="light"] #message-content,
html[data-theme="light"] .message-part,
html[data-theme="light"] .settingsbox,
html[data-theme="light"] .boxcontent,
html[data-theme="light"] .card,
html[data-theme="light"] .modal-content,
html[data-theme="light"] .ui-dialog {
  color: #13243b !important;
  background-color: rgba(255,255,255,.88) !important;
}
html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] h4,
html[data-theme="light"] h5,
html[data-theme="light"] h6,
html[data-theme="light"] strong { color: #10233c; }
html[data-theme="light"] .form-control,
html[data-theme="light"] .custom-select,
html[data-theme="light"] textarea,
html[data-theme="light"] input,
html[data-theme="light"] select {
  color: #13243b !important;
  background: rgba(255,255,255,.94) !important;
  border-color: rgba(28,61,98,.2) !important;
}
html[data-theme="light"] .btn-secondary,
html[data-theme="light"] .btn-light { color: #13243b !important; background: rgba(255,255,255,.88) !important; }
html[data-theme="light"] .cuzbro-theme-toggle { background: rgba(255,255,255,.94); box-shadow: 0 14px 34px rgba(38,67,103,.13); }
html[data-theme="light"] .cuzbro-theme-toggle button { color: rgba(19,36,59,.58); }
html[data-theme="light"] .cuzbro-theme-toggle button:hover,
html[data-theme="light"] .cuzbro-theme-toggle button.active { color: #10233c; }
html[data-theme="light"] .cuzbro-theme-toggle button.active { background: rgba(36,95,202,.12); box-shadow: inset 0 0 0 1px rgba(36,95,202,.2); }
html[data-theme="light"] .cuzbro-login-shell { background: rgba(255,255,255,.88); }
html[data-theme="light"] .cuzbro-login-brand { background: radial-gradient(circle at 80% 16%, rgba(255,157,28,.12), transparent 15rem), radial-gradient(circle at 10% 78%, rgba(74,140,255,.13), transparent 18rem); }
html[data-theme="light"] .cuzbro-login-brand p,
html[data-theme="light"] .cuzbro-login-form #login-footer { color: #526984; }
html[data-theme="light"] .cuzbro-login-form { background: rgba(237,243,250,.45); }

/* OBSERVATION // NIGHT VISION */
html[data-theme="observation"] {
  --cb-blue: #ff2b2b;
  --cb-cyan: #ff5757;
  --cb-orange: #ff3434;
  --cb-purple: #c92525;
  --cb-green: #ff4c4c;
  --cb-bg: #020000;
  --cb-panel: rgba(18,0,0,.92);
  --cb-panel-strong: rgba(9,0,0,.97);
  --cb-line: rgba(255,55,55,.20);
  --cb-text: #ff4a4a;
  --cb-muted: #c72d2d;
}
html[data-theme="observation"] body { color: #ff4a4a; background: #020000; }
html[data-theme="observation"] body::before { opacity: .08; filter: sepia(1) saturate(9) hue-rotate(310deg) brightness(.55); }
html[data-theme="observation"] *,
html[data-theme="observation"] h1,
html[data-theme="observation"] h2,
html[data-theme="observation"] h3,
html[data-theme="observation"] p,
html[data-theme="observation"] span,
html[data-theme="observation"] small,
html[data-theme="observation"] strong,
html[data-theme="observation"] em,
html[data-theme="observation"] label,
html[data-theme="observation"] a,
html[data-theme="observation"] button { text-shadow: none !important; }
html[data-theme="observation"] #layout-menu,
html[data-theme="observation"] #layout-sidebar,
html[data-theme="observation"] #layout-list,
html[data-theme="observation"] #layout-content,
html[data-theme="observation"] #compose-content,
html[data-theme="observation"] #message-content,
html[data-theme="observation"] .message-part,
html[data-theme="observation"] .settingsbox,
html[data-theme="observation"] .boxcontent,
html[data-theme="observation"] .card,
html[data-theme="observation"] .modal-content,
html[data-theme="observation"] .ui-dialog,
html[data-theme="observation"] .cuzbro-login-shell,
html[data-theme="observation"] .cuzbro-theme-toggle {
  color: #ff4a4a !important;
  background: rgba(12,0,0,.94) !important;
  border-color: rgba(255,48,48,.22) !important;
  box-shadow: 0 0 28px rgba(110,0,0,.12) !important;
}
html[data-theme="observation"] h1,
html[data-theme="observation"] h2,
html[data-theme="observation"] h3,
html[data-theme="observation"] h4,
html[data-theme="observation"] h5,
html[data-theme="observation"] h6,
html[data-theme="observation"] strong { color: #ff3434 !important; }
html[data-theme="observation"] p,
html[data-theme="observation"] .text-muted,
html[data-theme="observation"] .hint,
html[data-theme="observation"] .form-text { color: #c72d2d !important; }
html[data-theme="observation"] img { filter: grayscale(1) sepia(1) saturate(10) hue-rotate(310deg) brightness(.72) contrast(1.3); }
html[data-theme="observation"] .form-control,
html[data-theme="observation"] .custom-select,
html[data-theme="observation"] textarea,
html[data-theme="observation"] input,
html[data-theme="observation"] select {
  color: #ff4a4a !important;
  background: #090000 !important;
  border-color: rgba(255,48,48,.22) !important;
  caret-color: #ff3434;
}
html[data-theme="observation"] .cuzbro-theme-toggle button { color: rgba(255,64,64,.68); }
html[data-theme="observation"] .cuzbro-theme-toggle button:hover,
html[data-theme="observation"] .cuzbro-theme-toggle button.active { color: #ff4c4c !important; background: rgba(255,30,30,.10) !important; box-shadow: inset 0 0 0 1px rgba(255,48,48,.22) !important; }
html[data-theme="observation"] .cuzbro-login-brand #logo { filter: grayscale(1) sepia(1) saturate(10) hue-rotate(310deg) brightness(.72) contrast(1.3) drop-shadow(0 0 10px rgba(255,0,0,.2)); }
html[data-theme="observation"] .cuzbro-login-brand h2 { background: none; color: #ff2929 !important; -webkit-text-fill-color: #ff2929; }
html[data-theme="observation"] .cuzbro-login-brand { background: rgba(9,0,0,.72); }
html[data-theme="observation"] .cuzbro-login-form { background: rgba(2,0,0,.38); }

@media (max-width: 720px) {
  .cuzbro-login { padding: 58px 12px 78px !important; }
  .cuzbro-login-shell { grid-template-columns: 1fr; border-radius: 18px; }
  .cuzbro-login-brand { min-height: auto; padding: 34px 28px 28px; border-right: 0; border-bottom: 1px solid var(--cb-line); }
  .cuzbro-login-brand #logo { width: 190px; margin-bottom: 22px; }
  .cuzbro-login-brand h2 { font-size: 2.25rem; }
  .cuzbro-login-form { padding: 30px 28px 36px !important; }
  .cuzbro-theme-toggle { right: 8px; bottom: 8px; }
  .cuzbro-theme-toggle button { height: 29px; padding: 0 8px; font-size: .57rem; }
}
