/*
 * Promtek login system-theme bridge.
 * On the login page only, the operating-system preference wins over
 * Roundcube's browser-specific colorMode cookie.
 */

@media (prefers-color-scheme: light) {
  html,
  html.dark-mode,
  html.light-mode {
    background: #faf8f5 !important;
    color-scheme: light;
  }

  html body.task-login,
  html.dark-mode body.task-login,
  html.light-mode body.task-login {
    --pk-accent: #ec8a1a !important;
    --pk-accent-hover: #d2761d !important;
    --pk-accent-ring: rgba(236, 138, 26, 0.18) !important;
    --pk-page: #faf8f5 !important;
    --pk-panel: #221e1a !important;
    --pk-field: #ffffff !important;
    --pk-border: #d9d2c9 !important;
    --pk-rule: #e7e1da !important;
    --pk-ink: #231f1b !important;
    --pk-ink-2: #4b443d !important;
    --pk-muted: #746b62 !important;
    --pk-faint: #aaa198 !important;
    --pk-on-panel: #f6f2ec !important;
    --pk-on-panel-mut: #9f968d !important;
    color: var(--pk-ink) !important;
    background: var(--pk-page) !important;
    color-scheme: light;
  }

  html.dark-mode body.task-login #login-brand,
  html.light-mode body.task-login #login-brand {
    border-right: 0 !important;
  }

  html.dark-mode body.task-login a,
  html.light-mode body.task-login a {
    color: #c9721b !important;
  }
}

@media (prefers-color-scheme: dark) {
  html,
  html.dark-mode,
  html.light-mode {
    background: #17140f !important;
    color-scheme: dark;
  }

  html body.task-login,
  html.dark-mode body.task-login,
  html.light-mode body.task-login {
    --pk-accent: #ec8a1a !important;
    --pk-accent-hover: #f59d33 !important;
    --pk-accent-ring: rgba(236, 138, 26, 0.20) !important;
    --pk-page: #17140f !important;
    --pk-panel: #0e0c09 !important;
    --pk-field: #211c17 !important;
    --pk-border: #3a332b !important;
    --pk-rule: #2a241e !important;
    --pk-ink: #f6f2ec !important;
    --pk-ink-2: #c4bcb2 !important;
    --pk-muted: #9a9188 !important;
    --pk-faint: #746b62 !important;
    --pk-on-panel: #f6f2ec !important;
    --pk-on-panel-mut: #9a9188 !important;
    color: var(--pk-ink) !important;
    background: var(--pk-page) !important;
    color-scheme: dark;
  }

  html body.task-login #login-brand,
  html.dark-mode body.task-login #login-brand,
  html.light-mode body.task-login #login-brand {
    border-right: 1px solid var(--pk-rule) !important;
  }

  html body.task-login a,
  html.dark-mode body.task-login a,
  html.light-mode body.task-login a {
    color: #e9a254 !important;
  }
}
