/*
 * Hand-written fixes, loaded last.
 * UIkit (loaded from CDN) has no dark mode, while the theme and our views follow
 * prefers-color-scheme. Without these rules UIkit modals and inputs stay white in
 * dark mode while their text turns white, so the text disappears.
 * Palette matches the views: page slate-950, surfaces slate-900, borders slate-700.
 */
@media (prefers-color-scheme: dark) {
  /* UIkit paints html white; below a short page's body that showed as a white band. Matches body's dark:bg-slate-950. */
  html {
    background-color: #020617;
  }

  .uk-modal-dialog,
  .uk-dropdown,
  .uk-card-default {
    background-color: #0f172a;
    color: #e2e8f0;
  }

  .uk-modal-footer {
    background-color: #0f172a;
    border-top-color: #334155;
  }

  .uk-modal-title,
  .uk-modal-dialog h1,
  .uk-modal-dialog h2,
  .uk-modal-dialog h3 {
    color: #fff;
  }

  .uk-form-label {
    color: #cbd5e1;
  }

  .uk-close,
  .uk-modal-close-default {
    color: #94a3b8;
  }

  .uk-close:hover,
  .uk-modal-close-default:hover {
    color: #fff;
  }

  /* input.uk-input beats both the theme's input[type] rules and UIkit's .uk-input:focus */
  input.uk-input,
  input.uk-input:focus,
  select.uk-select,
  select.uk-select:focus,
  textarea.uk-textarea,
  textarea.uk-textarea:focus {
    background-color: #1e293b;
    color: #f8fafc;
    border-color: #334155;
  }

  input.uk-input:focus,
  select.uk-select:focus,
  textarea.uk-textarea:focus {
    border-color: #3b82f6;
  }

  input.uk-input::placeholder,
  textarea.uk-textarea::placeholder {
    color: #94a3b8;
  }

  .uk-button-default {
    background-color: #334155;
    color: #f1f5f9;
    border-color: #475569;
  }

  .uk-button-default:hover,
  .uk-button-default:focus {
    background-color: #475569;
    color: #fff;
    border-color: #64748b;
  }

  .uk-text-meta,
  .uk-link-muted,
  .uk-link-muted a {
    color: #94a3b8;
  }

  .uk-link-muted:hover {
    color: #e2e8f0;
  }

  .uk-notification-message {
    background-color: #1e293b;
    color: #e2e8f0;
  }

  .uk-alert-danger {
    background-color: rgba(127, 29, 29, 0.3);
    color: #fca5a5;
  }
}
