/* Font import — @import must be first, before any other rules */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&display=swap');

/*
 * caddy-login.css — Openbar dark theme for caddy-security login page
 * Loaded AFTER /auth/assets/css/login.css via `custom css path` in Caddy config.
 * Uses !important selectively to override Tailwind utility classes.
 *
 * Design tokens mirror landing.html:
 *   --accent        #5d6bff
 *   --bg            #070708
 *   --surface       rgba(20,20,24,.82)
 *   --surface-strong rgba(28,28,34,.96)
 *   --border        rgba(120,120,150,.18)
 *   --border-hover  rgba(93,107,255,.36)
 *   --text-primary  #f4f4f8
 *   --text-secondary #9a9aae
 *   --text-muted    #6a6a7c
 *   --radius        18px
 */

/* ─── Tokens ─────────────────────────────────────────────── */
:root {
  --ob-accent:          #5d6bff;
  --ob-accent-soft:     rgba(93, 107, 255, .12);
  --ob-accent-border:   rgba(93, 107, 255, .32);
  --ob-bg:              #070708;
  --ob-surface:         rgba(20, 20, 24, .92);
  --ob-surface-strong:  rgba(28, 28, 34, .98);
  --ob-border:          rgba(120, 120, 150, .18);
  --ob-border-hover:    rgba(93, 107, 255, .36);
  --ob-text-primary:    #f4f4f8;
  --ob-text-secondary:  #9a9aae;
  --ob-text-muted:      #6a6a7c;
  --ob-shadow-sm:       0 1px 0 rgba(255,255,255,.02), 0 8px 24px rgba(0,0,0,.28);
  --ob-shadow-lg:       0 16px 42px rgba(0,0,0,.52), 0 0 0 1px rgba(93,107,255,.14);
  --ob-radius:          18px;
}

/* ─── Font ───────────────────────────────────────────────── */
html, body, input, button, select, textarea {
  font-family: 'IBM Plex Mono', monospace !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Page background ────────────────────────────────────── */
/* Override Tailwind's .bg-blue-100 on <html> */
html {
  background-color: var(--ob-bg) !important;
}

body {
  background-color: var(--ob-bg) !important;
  /* Radial glow at top — matches landing page atmosphere */
  background-image:
    radial-gradient(circle at top, rgba(93, 107, 255, .12), transparent 35%),
    radial-gradient(circle at 20% 20%, rgba(93, 107, 255, .08), transparent 22%) !important;
  color: var(--ob-text-primary) !important;
  min-height: 100vh;
}

/* ─── Page structure ─────────────────────────────────────── */
.app-page {
  background: transparent !important;
  min-height: 100vh;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.app-content {
  background: transparent !important;
  width: 100%;
  max-width: 26rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  /* Staggered entrance — mirrors landing.html @keyframes fadeUp */
  animation: ob-fadeUp .45s ease both;
}

@keyframes ob-fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Card container ─────────────────────────────────────── */
/* The white card with shadow — override to dark surface */
.app-container {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, .030),
    rgba(255, 255, 255, .015)
  ) !important;
  border: 1px solid var(--ob-border) !important;
  border-radius: var(--ob-radius) !important;
  box-shadow: var(--ob-shadow-sm) !important;
  padding: 2rem 1.75rem !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ─── Logo area ──────────────────────────────────────────── */
.logo-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.75rem;
}

/* Hide the default logo image — no custom SVG yet */
.logo-img {
  display: none !important;
}

/* "Sign In" heading */
.logo-txt {
  font-family: 'IBM Plex Mono', monospace !important;
  font-size: 1.05rem !important;
  font-weight: 600 !important;
  letter-spacing: .06em !important;
  text-transform: uppercase !important;
  color: var(--ob-text-secondary) !important;
  margin: 0 !important;
}

/* ─── Authenticators list ────────────────────────────────── */
#authenticators {
  display: flex !important;
  flex-direction: column !important;
  gap: .625rem !important;
}

/* ─── Azure / OAuth login button ────────────────────────── */
/* .app-login-btn-box wraps the coloured icon + text side by side */
.app-login-btn-box {
  display: flex !important;
  align-items: stretch !important;
  border: 1px solid var(--ob-border) !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  background: var(--ob-surface) !important;
  cursor: pointer;
  transition:
    transform 180ms cubic-bezier(.22, .68, 0, 1.2),
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.app-login-btn-box:hover {
  transform: translateY(-2px);
  border-color: var(--ob-border-hover) !important;
  box-shadow: var(--ob-shadow-lg) !important;
}

.app-login-btn-box:active {
  transform: translateY(-1px);
  transition-duration: 80ms;
}

/* Left coloured icon tile — keep the accent colour but darken slightly */
/* The base sets bg-[#03a9f4] inline; we override via the child selector */
.app-login-btn-box > div:first-child {
  background: var(--ob-accent) !important;
  color: #fff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 1.1rem !important;
  font-size: 1.4rem !important;
  flex-shrink: 0;
  min-width: 3.25rem;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* Right text tile */
.app-login-btn-txt {
  flex: 1;
  display: flex !important;
  align-items: center !important;
  padding: .875rem 1.1rem !important;
  background: transparent !important;
  color: var(--ob-text-primary) !important;
}

.app-login-btn-txt span {
  font-family: 'IBM Plex Mono', monospace !important;
  font-size: .82rem !important;
  font-weight: 600 !important;
  letter-spacing: .08em !important;
  color: var(--ob-text-primary) !important;
  text-transform: uppercase !important;
}

/* Anchor wrapper — remove any default link chrome */
#authenticators a {
  text-decoration: none !important;
  display: block;
  outline: none;
}

#authenticators a:focus-visible .app-login-btn-box {
  border-color: var(--ob-accent) !important;
  box-shadow: 0 0 0 3px rgba(93, 107, 255, .22) !important;
}

/* ─── Portal page link buttons ───────────────────────────── */
/* The portal page uses similar .app-login-btn-box but icon tiles may
   have different inline bg classes. Override all children broadly. */
.app-login-btn-box > div {
  background: transparent !important;
  color: var(--ob-text-secondary) !important;
  border: none !important;
  box-shadow: none !important;
}

/* Re-apply accent only on the first child (icon tile) */
.app-login-btn-box > div:first-child {
  background: var(--ob-accent) !important;
  color: #fff !important;
}

/* Portal page description text */
.app-container p {
  color: var(--ob-text-muted) !important;
}

/* ─── Bookmarks / QR section ─────────────────────────────── */
/* Style dark or hide — we hide it for a cleaner experience */
#bookmarks {
  display: none !important;
}

/* ─── Any remaining light-coloured elements ─────────────── */
/* Catch-all for text that may render in dark colours */
p, span, label, h1, h2, h3, h4, a {
  color: inherit;
}

/* Links inside the card */
.app-container a {
  color: var(--ob-accent) !important;
  text-decoration: none;
}

.app-container a:hover {
  color: var(--ob-text-primary) !important;
}

/* Inputs (username/password fields, if the local auth form is ever shown) */
.app-container input[type="text"],
.app-container input[type="email"],
.app-container input[type="password"] {
  background: rgba(255, 255, 255, .04) !important;
  border: 1px solid var(--ob-border) !important;
  border-radius: 10px !important;
  color: var(--ob-text-primary) !important;
  padding: .65rem .9rem !important;
  width: 100%;
  font-family: 'IBM Plex Mono', monospace !important;
  font-size: .85rem !important;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.app-container input[type="text"]:focus,
.app-container input[type="email"]:focus,
.app-container input[type="password"]:focus {
  border-color: rgba(93, 107, 255, .4) !important;
  box-shadow: 0 0 0 3px rgba(93, 107, 255, .08) !important;
}

.app-container input::placeholder {
  color: var(--ob-text-muted) !important;
}

/* Submit / action buttons (local auth form) */
.app-container button[type="submit"],
.app-container input[type="submit"] {
  background: var(--ob-accent) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 10px !important;
  padding: .65rem 1.25rem !important;
  font-family: 'IBM Plex Mono', monospace !important;
  font-size: .82rem !important;
  font-weight: 600 !important;
  letter-spacing: .05em !important;
  cursor: pointer;
  transition: opacity 150ms ease, transform 150ms ease;
}

.app-container button[type="submit"]:hover,
.app-container input[type="submit"]:hover {
  opacity: .88;
  transform: translateY(-1px);
}

/* Error / alert messages */
.app-container .alert,
.app-container [class*="error"],
.app-container [class*="alert"] {
  background: rgba(248, 113, 113, .1) !important;
  border: 1px solid rgba(248, 113, 113, .3) !important;
  border-radius: 10px !important;
  color: #fca5a5 !important;
  padding: .6rem .9rem !important;
  font-size: .82rem !important;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .app-container {
    padding: 1.5rem 1.25rem !important;
  }
}
