/* Pannipitiya Residence look for the Authelia login pages. nginx links this file into every /auth page.
   Colours and glass match the house app (public/css/app.css). */
@font-face { font-family: 'Lato'; src: url('fonts/lato-latin-300-normal.woff2') format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Lato'; src: url('fonts/lato-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Lato'; src: url('fonts/lato-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }

/* Authelia's own colour tokens, in every theme it offers */
html[data-theme] {
  color-scheme: dark;
  --background: #1b1b1d;
  --foreground: #f4f4f6;
  --card: rgba(255, 255, 255, 0.04);
  --card-foreground: #f4f4f6;
  --popover: #26262a;
  --popover-foreground: #f4f4f6;
  --primary: #ffb45c;
  --primary-foreground: #1b1b1d;
  --secondary: #ffb45c;
  --secondary-foreground: #1b1b1d;
  --accent: rgba(255, 255, 255, 0.08);
  --accent-foreground: #f4f4f6;
  --muted: rgba(255, 255, 255, 0.06);
  --muted-foreground: rgba(244, 244, 246, 0.64);
  --border: rgba(255, 255, 255, 0.16);
  --input: rgba(255, 255, 255, 0.16);
  --divider: rgba(255, 255, 255, 0.12);
  --ring: #ffb45c;
  --info: #7cc7ff;
  --success: #39d07a;
  --warning: #ffc53d;
  --destructive: #ff5a52;
  --custom-icon: #f4f4f6;
  --custom-loading-bar: #ffb45c;
  --radius: 12px;
}

body {
  font-family: 'Lato', system-ui, -apple-system, 'Segoe UI', sans-serif !important;
  background: #121214 url('bg.jpg') center 40% / cover no-repeat fixed !important;
  color: #f4f4f6;
  -webkit-font-smoothing: antialiased;
}
/* dim the photo so the card reads clearly, darker at the edges */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 45%, rgba(12, 12, 16, 0.30), rgba(12, 12, 16, 0.82) 78%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 28%, transparent 62%, rgba(0, 0, 0, 0.70));
}
#root { position: relative; z-index: 1; }
#root button, #root input, #root label, #root h5, #root h6, #root p, #root a { font-family: inherit; }

/* the glass card around each step (sign in, 2FA, passkeys…) */
[id$="-stage"] > div {
  width: calc(100% - 32px) !important;
  max-width: 400px !important;
  margin: 24px auto !important;
  padding: 32px 28px 20px !important;
  background: rgba(30, 30, 34, 0.58);
  -webkit-backdrop-filter: blur(24px) saturate(1.25);
  backdrop-filter: blur(24px) saturate(1.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* the house logo instead of the generic person icon */
#UserSvg { display: none !important; }
div:has(> #UserSvg) { padding: 0 0 6px !important; }
div:has(> #UserSvg)::before {
  content: '';
  display: block;
  width: 64px;
  height: 64px;
  margin: 0 auto;
  border-radius: 18px;
  background: url('logo.png') center / cover;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

/* "Pannipitiya Residence" above the sign-in heading */
#first-factor-stage h5::before {
  content: 'Pannipitiya Residence';
  display: block;
  margin: 10px 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #ffb45c;
}
[id$="-stage"] h5 { font-weight: 300 !important; letter-spacing: 0.01em; }

/* fields */
#root input[data-slot="floating-input"], #root input[type="text"], #root input[type="password"] {
  background: rgba(0, 0, 0, 0.28) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  border-radius: 12px !important;
}
#root input:focus { border-color: #ffb45c !important; box-shadow: 0 0 0 3px rgba(255, 180, 92, 0.22) !important; }

/* buttons: warm primary, glass for the passkey alternative */
#root button.bg-primary {
  height: 46px !important;
  border-radius: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em;
  box-shadow: 0 8px 22px rgba(255, 143, 58, 0.25);
}
#root button.bg-primary:hover { background: #ffc27a !important; }
#root #passkey-sign-in-button {
  background: rgba(255, 255, 255, 0.07) !important;
  color: #f4f4f6 !important;
  border: 1px solid rgba(255, 180, 92, 0.55) !important;
  box-shadow: none;
}
#root #passkey-sign-in-button:hover { background: rgba(255, 180, 92, 0.14) !important; }
#root #remember-checkbox[aria-checked="true"] { background: #ffb45c; border-color: #ffb45c; color: #1b1b1d; }

/* quieter footer and language switch */
#root a[href*="authelia.com"] { color: rgba(244, 244, 246, 0.32) !important; }
#language-button { color: rgba(244, 244, 246, 0.72) !important; }

@media (max-width: 420px) {
  [id$="-stage"] > div { padding: 28px 20px 16px !important; border-radius: 18px; }
}
