/* =============================================================================
 * Authelia login portal theme — matches https://ryan.hellyer.kiwi
 *
 * Authelia 4.39.28 is a Tailwind v4 + shadcn UI app. It ships its own
 * stylesheet (static/css/index.*.css) and no custom-CSS hook, so nginx injects
 * this file into the portal HTML (see nginx/conf.d/auth-site.conf) and serves
 * it same-origin from /themes/rh-theme.css.
 *
 * The reliable way to reskin it is to override its shadcn CSS custom properties
 * (--primary, --ring, --radius, ...), because every component consumes those.
 * A few component-level rules follow for the pill button and to hide the logo.
 *
 * Theme switching: Authelia sets `data-theme="light|dark"` on <html> (driven by
 * `theme: auto` + the OS preference), so both are overridden below.
 *
 * Palette from the site's own style.css:
 *   accent #fc364d   accent-shadow #b8273a
 *   primary #d32f3f  primary-shadow #a81d2b
 *   ink #18181b  body #3f3f46  muted #a1a1aa
 *   line #e4e4e7  panel #fafafa
 * ========================================================================== */

@font-face {
	font-family: "Outfit";
	font-style: normal;
	font-weight: 300 700;
	font-display: swap;
	src: url("/themes/fonts/outfit.woff2") format("woff2");
}

/* ---------------------------------------------------------------------------
 * Light theme
 * ------------------------------------------------------------------------ */
:root,
:root[data-theme="light"],
[data-theme="light"] {
	/* shadcn/Tailwind tokens Authelia reads for controls, focus and text */
	--primary: #d32f3f;
	--primary-foreground: #ffffff;
	--ring: #d32f3f;
	--secondary: #fc364d;
	--secondary-foreground: #ffffff;
	--accent: #fafafa;
	--accent-foreground: #18181b;
	--destructive: #fc364d;
	--destructive-foreground: #ffffff;

	--background: #ffffff;
	--foreground: #18181b;
	--card: #ffffff;
	--card-foreground: #18181b;
	--popover: #ffffff;
	--popover-foreground: #18181b;
	--muted: #fafafa;
	--muted-foreground: #3f3f46;
	--border: #e4e4e7;
	--input: #e4e4e7;

	/* Authelia's own custom tokens */
	--custom-icon: #18181b;
	--custom-loading-bar: #fc364d;
	--divider: rgba(24, 24, 27, 0.12);

	/* Typography + shape */
	--font-sans: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
	--radius: 0.75rem;
}

/* ---------------------------------------------------------------------------
 * Dark theme
 * ------------------------------------------------------------------------ */
[data-theme="dark"] {
	--primary: #fc364d;
	--primary-foreground: #ffffff;
	--ring: #fc364d;
	--secondary: #fc364d;
	--secondary-foreground: #ffffff;
	--accent: #27272a;
	--accent-foreground: #fafafa;
	--destructive: #fc364d;
	--destructive-foreground: #ffffff;

	--background: #18181b;
	--foreground: #fafafa;
	--card: #27272a;
	--card-foreground: #fafafa;
	--popover: #27272a;
	--popover-foreground: #fafafa;
	--muted: #27272a;
	--muted-foreground: rgba(250, 250, 250, 0.7);
	--border: #3f3f46;
	--input: #3f3f46;

	--custom-icon: #fafafa;
	--custom-loading-bar: #fc364d;
	--divider: rgba(250, 250, 250, 0.12);
}

/* ---------------------------------------------------------------------------
 * Typography — Outfit everywhere
 * ------------------------------------------------------------------------ */
html,
body,
button,
input,
select,
textarea {
	font-family: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Headings on the site are bold with tight tracking (h1-h4 { font-weight:700 }). */
h1,
h2,
h3,
h4,
h5,
h6 {
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--foreground);
}

/* ---------------------------------------------------------------------------
 * Remove the avatar/logo — and the empty wrapper it leaves behind
 * ------------------------------------------------------------------------ */
img[alt="Logo"],
img[alt="logo"],
img[alt="Authelia"] {
	display: none !important;
}

.w-full.p-2:has(> img[alt="Logo"]) {
	display: none;
}

/* ---------------------------------------------------------------------------
 * Buttons — the site's chunky pill with its signature hover inversion
 * (solid red -> white bg + red text + red border).
 * Authelia's submit is:  <button data-slot="button" data-variant="default">
 * ------------------------------------------------------------------------ */
[data-slot="button"] {
	height: 3.25rem !important;
	border-radius: 99rem !important;
	font-size: 1rem !important;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none !important;
	border: 2px solid var(--primary);
}

[data-slot="button"]:hover {
	background: var(--background) !important;
	color: var(--primary) !important;
}

[data-slot="button"]:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent);
}

/* ---------------------------------------------------------------------------
 * Inputs — the site's filled fields: soft grey body, white + red border on
 * focus. Authelia's floating-label field is [data-slot="floating-input"].
 * ------------------------------------------------------------------------ */
[data-slot="floating-input"] {
	border-radius: 0.75rem !important;
	background: var(--muted);
}

[data-slot="floating-input"]:focus {
	background: var(--background);
}

/* The floating labels sit over the field; keep them legible on our colours. */
[data-slot="floating-input"] + label {
	color: var(--muted-foreground);
}

/* ---------------------------------------------------------------------------
 * Checkbox — slightly larger radius to match the soft look
 * ------------------------------------------------------------------------ */
[data-slot="checkbox"] {
	border-radius: 0.35rem !important;
}

/* ---------------------------------------------------------------------------
 * Footer "Powered by Authelia" link
 * ------------------------------------------------------------------------ */
a[href="https://www.authelia.com"] {
	color: var(--muted-foreground);
}
