/* BeaverLodge skin for the Authelia login portal — matches /var/www/html/index.html.
   Overrides Authelia's dark-theme variables; injected by nginx (snippets/authelia-portal.conf). */
:root[data-theme=dark], [data-theme=dark] {
  --background: #121212;
  --foreground: #e0e0e0;
  --card: #1e1e1e;
  --card-foreground: #e0e0e0;
  --popover: #1e1e1e;
  --popover-foreground: #e0e0e0;
  --primary: #3b82f6;
  --primary-foreground: #ffffff;
  --muted: #1e1e1e;
  --muted-foreground: #a0a0a0;
  --accent: #2a2a2a;
  --accent-foreground: #ffffff;
  --border: #2a2a2a;
  --input: #2a2a2a;
  --ring: #3b82f6;
  --radius: 8px;
}
html, body, button, input, select, textarea {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}
body { background-color: #121212; }
a { color: #3b82f6; }

/* Phones (2026-11-22): the six OTP boxes (40px each + margins) didn't fit the 320px-max login column next to
   the card padding, so the 6th box wrapped. On phones: widen the column, trim padding, and let the boxes shrink
   to share whatever width there is, never wrapping. Works whether the inputs sit directly in the OTP wrapper
   or in a div inside it. */
@media (max-width: 480px) {
  [class~="max-w-xs"] { max-width: 100% !important; }
  [class~="max-w-[444px]"][class~="px-8"] { padding-left: .75rem !important; padding-right: .75rem !important; }
  [class~="min-w-[300px]"][class~="p-8"] { padding: 1.25rem .75rem !important; min-width: 0 !important; }
  /* the dial, the boxes and the explanation are siblings in a wrapping row: give the boxes a row of their own */
  [class*="[&_input]:size-10"] { flex: 0 0 100% !important; width: 100%; max-width: 22rem; margin: .75rem auto; }
  [class*="[&_input]:size-10"], [class*="[&_input]:size-10"] div:has(> input) {
    display: flex !important; flex-wrap: nowrap !important; justify-content: center; gap: 6px; width: 100%;
  }
  [class*="[&_input]:size-10"] input {
    flex: 1 1 0 !important; min-width: 0 !important; max-width: 3rem !important;
    width: auto !important; height: 3.2rem !important; margin: 0 !important; font-size: 1.4rem !important;
  }
}

/* OTP boxes (2026-11-22): Authelia draws them with a 30% black border, almost invisible on the dark page.
   Grey border + slightly lighter fill; blue when focused. Authelia's red "wrong code" border is left alone. */
[class*="[&_input]:size-10"]:not([class*="border-[rgba(255"]) input {
  border: 2px solid #6b7280 !important;
}
[class*="[&_input]:size-10"] input { background-color: #1e1e1e !important; color: #ffffff; }
[class*="[&_input]:size-10"]:not([class*="border-[rgba(255"]) input:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .35);
  outline: none;
}
[class*="[&_input]:size-10"][class*="border-[rgba(255"] input { border-width: 2px !important; }
