/*
 * Base reset + typography + shared utility classes.
 *
 * Loaded on every surface. Public, Access, OS console, customer / vendor /
 * supplier portals — all read from this baseline. Module-specific styling
 * builds on top.
 */

/* ===================================================================
 * RESET
 * ============================================================== */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	/* Anchor jumps land below the fixed public header instead of behind it. */
	scroll-padding-top: var(--eos-header-height);
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

html,
body {
	margin: 0;
	padding: 0;
	background: var(--eos-bg);
	color: var(--eos-text);
	font-family: var(--eos-font-sans);
	font-size: var(--eos-text-base);
	line-height: var(--eos-leading-normal);
}

body {
	min-height: 100vh;
	overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
	margin: 0;
	font-family: var(--eos-font-sans);
	font-weight: var(--eos-weight-semibold);
	color: var(--eos-text);
	letter-spacing: var(--eos-tracking-tight);
}

p {
	margin: 0;
}

a {
	color: var(--eos-text);
	text-decoration: none;
	transition: color var(--eos-duration-fast) var(--eos-easing);
}
a:hover,
a:focus {
	color: var(--eos-accent);
}

img, svg, video, canvas {
	display: block;
	max-width: 100%;
	height: auto;
}

button {
	font: inherit;
	color: inherit;
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
}

input, select, textarea {
	font: inherit;
	color: inherit;
}

table {
	border-collapse: collapse;
	width: 100%;
}

ul, ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

hr {
	margin: 0;
	border: 0;
	border-top: var(--eos-border-width) solid var(--eos-border);
}

::selection {
	background: var(--eos-accent);
	color: var(--eos-text-inverse);
}

:focus-visible {
	outline: 2px solid var(--eos-focus-ring);
	outline-offset: 2px;
}

/* ===================================================================
 * SKIP LINK — keyboard accessibility
 * ============================================================== */

.eos-skip-link {
	position: absolute;
	top: -100px;
	left: var(--eos-space-4);
	background: var(--eos-accent);
	color: var(--eos-text-inverse);
	padding: var(--eos-space-2) var(--eos-space-4);
	font-family: var(--eos-font-mono);
	font-size: var(--eos-text-sm);
	font-weight: var(--eos-weight-medium);
	text-transform: uppercase;
	letter-spacing: var(--eos-tracking-wider);
	text-decoration: none;
	z-index: var(--eos-z-toast);
	transition: top var(--eos-duration-base) var(--eos-easing);
}
.eos-skip-link:focus {
	top: var(--eos-space-4);
	color: var(--eos-text-inverse);
}


/* ===================================================================
 * SHARED TYPOGRAPHY UTILITIES
 *
 * .eos-meta — the sanctioned monospace utility. Use for labels,
 * timestamps, status pills, navigation, table headers, part numbers,
 * work order numbers, system metadata. Do NOT apply mono to body text.
 * ============================================================== */

.eos-meta {
	font-family: var(--eos-font-mono);
	font-size: var(--eos-text-xs);
	font-weight: var(--eos-weight-medium);
	text-transform: uppercase;
	letter-spacing: var(--eos-tracking-widest);
	color: var(--eos-text-muted);
	line-height: 1;
}

.eos-link {
	color: var(--eos-accent);
	text-decoration: none;
	border-bottom: 1px solid currentColor;
}
.eos-link:hover,
.eos-link:focus {
	color: var(--eos-accent-hover);
}

.eos-h-display {
	font-size: clamp(var(--eos-text-4xl), 6vw, var(--eos-text-7xl));
	line-height: var(--eos-leading-tight);
	font-weight: var(--eos-weight-bold);
	letter-spacing: var(--eos-tracking-tight);
	color: var(--eos-text);
}

.eos-h-section {
	font-size: clamp(var(--eos-text-2xl), 3vw, var(--eos-text-4xl));
	line-height: var(--eos-leading-snug);
	font-weight: var(--eos-weight-semibold);
	color: var(--eos-text);
}

.eos-h-card {
	font-size: var(--eos-text-xl);
	line-height: var(--eos-leading-snug);
	font-weight: var(--eos-weight-semibold);
	color: var(--eos-text);
}

.eos-lead {
	margin-top: var(--eos-space-5);
	font-size: var(--eos-text-lg);
	line-height: var(--eos-leading-relaxed);
	color: var(--eos-text-muted);
	max-width: 60ch;
}


/* ===================================================================
 * LAYOUT PRIMITIVES
 * ============================================================== */

.eos-container {
	width: 100%;
	max-width: var(--eos-container);
	margin: 0 auto;
	padding-left: var(--eos-space-5);
	padding-right: var(--eos-space-5);
}
.eos-container--narrow {
	max-width: var(--eos-container-narrow);
}
.eos-container--wide {
	max-width: var(--eos-container-wide);
}
@media (min-width: 720px) {
	.eos-container {
		padding-left: var(--eos-space-6);
		padding-right: var(--eos-space-6);
	}
}
@media (min-width: 1280px) {
	.eos-container {
		padding-left: var(--eos-space-8);
		padding-right: var(--eos-space-8);
	}
}

.eos-main {
	display: block;
}


/* ===================================================================
 * EMPTY-STATE COMPONENT
 * Used as a fallback when the elintra-os plugin isn't active, by the 404
 * page, and by any module's "no records yet" state.
 * ============================================================== */

.eos-empty {
	max-width: 60ch;
	margin: var(--eos-space-9) auto;
	padding: var(--eos-space-7) var(--eos-space-5);
	text-align: center;
}
.eos-empty .eos-meta {
	display: block;
	margin-bottom: var(--eos-space-3);
}
.eos-empty .eos-h-section {
	margin-bottom: var(--eos-space-3);
}
.eos-empty__body {
	color: var(--eos-text-muted);
	line-height: var(--eos-leading-relaxed);
}
.eos-empty p + p {
	margin-top: var(--eos-space-4);
}


/* ===================================================================
 * SURFACES
 * ============================================================== */

.eos-surface--public,
.eos-surface--private {
	background: var(--eos-bg);
}


/* ===================================================================
 * ACCESS PAGE CHROME — owned by the theme.
 *
 * Three-row layout: minimal logo bar at the top, centered form card in the
 * middle, secure-connection bar at the bottom. Pure black background with
 * an optional licensed atmospheric image (--eos-access-image) faded behind
 * a subtle radial vignette so the form card always reads cleanly.
 *
 * The form card itself (its title, fields, submit button, and badge reader)
 * is rendered and styled by the elintra-os plugin's [elintra_access]
 * shortcode. The theme owns only the chrome around it.
 * ============================================================== */

.eos-access-page {
	position: relative;
	min-height: 100vh;
	min-height: 100svh;
	display: grid;
	grid-template-rows: auto 1fr auto;
	background: var(--eos-bg);
	overflow: hidden;
}
.eos-access-page::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: var(--eos-access-image, none);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	opacity: 0.32;
	pointer-events: none;
	z-index: 0;
}
/*
 * Cinematic vignette is dark-theme-only. The radial gradient relies on
 * `rgba(0,0,0,0.55)` darkening toward the page edges — which produces
 * the intended premium spotlight effect on a near-black background, but
 * paints a muddy gray haze on the off-white light-theme background. In
 * light mode we suppress the vignette entirely so the page reads as a
 * plain off-white surface, matching the OS console light theme.
 *
 * The `.eos-access-page::before` decorative image is also suppressed in
 * light mode for the same reason — the `Hero` cinematic backdrop is
 * tuned for dark surfaces and clutters the light surface without it.
 */
[data-eos-theme="dark"] .eos-access-page::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		radial-gradient(ellipse 65% 55% at 50% 45%, transparent 0%, rgba(0, 0, 0, 0.55) 70%, var(--eos-bg) 100%),
		linear-gradient(to bottom, var(--eos-bg) 0%, transparent 12%, transparent 78%, var(--eos-bg) 100%);
	pointer-events: none;
	z-index: 1;
}
[data-eos-theme="light"] .eos-access-page::before { display: none; }
[data-eos-theme="light"] .eos-access-page::after  { display: none; }

.eos-access-page > * { position: relative; z-index: 2; }

/* Top bar — logo left, back-to-home right */
.eos-access-page__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--eos-space-5);
	padding: var(--eos-space-5) var(--eos-space-5);
	min-height: 64px;
}
@media (min-width: 720px) {
	.eos-access-page__top {
		padding: var(--eos-space-6) var(--eos-space-7);
		min-height: 76px;
	}
}

.eos-access-page__brand-link {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	color: var(--eos-text);
	transition: opacity var(--eos-duration-fast) var(--eos-easing);
}
.eos-access-page__brand-link:hover,
.eos-access-page__brand-link:focus { opacity: 0.85; color: var(--eos-text); }

.eos-access-page__logo {
	display: block;
	width: auto;
	height: auto;
	max-width: 125px;
	max-height: 28px;
}
@media (min-width: 880px) {
	.eos-access-page__logo {
		max-width: 160px;
		max-height: 34px;
	}
}

/*
 * Theme-aware logo swap. Both variants are rendered in the markup so
 * the swap is instant and there's no flash of the wrong asset on theme
 * change. The element matching the active theme is shown, the other is
 * hidden via display:none.
 */
[data-eos-theme="dark"]  .eos-access-page__logo--light { display: none; }
[data-eos-theme="light"] .eos-access-page__logo--dark  { display: none; }
.eos-access-page__brand-name {
	font-family: var(--eos-font-sans);
	font-size: var(--eos-text-base);
	font-weight: var(--eos-weight-bold);
	letter-spacing: var(--eos-tracking-widest);
}

.eos-access-page__back {
	display: inline-flex;
	align-items: center;
	gap: var(--eos-space-2);
	padding: var(--eos-space-2) var(--eos-space-3);
	font-family: var(--eos-font-mono);
	font-size: var(--eos-text-xs);
	text-transform: uppercase;
	letter-spacing: var(--eos-tracking-wider);
	color: var(--eos-text-muted);
	text-decoration: none;
	transition: color var(--eos-duration-fast) var(--eos-easing);
}
.eos-access-page__back:hover,
.eos-access-page__back:focus {
	color: var(--eos-text);
}
.eos-access-page__back-arrow {
	display: inline-block;
	transition: transform var(--eos-duration-base) var(--eos-easing);
}
.eos-access-page__back:hover .eos-access-page__back-arrow,
.eos-access-page__back:focus .eos-access-page__back-arrow {
	transform: translateX(-3px);
}

/* Center — vertical+horizontal flex centering for the form card */
.eos-access-page__main {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(2rem, 5vw, 4rem) var(--eos-space-5);
}

/* Bottom — secure-connection bar */
.eos-access-page__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--eos-space-4);
	flex-wrap: wrap;
	padding: var(--eos-space-5) var(--eos-space-5);
	min-height: 56px;
}
@media (min-width: 720px) {
	.eos-access-page__footer {
		padding: var(--eos-space-5) var(--eos-space-7);
	}
}
.eos-access-page__secure,
.eos-access-page__help {
	margin: 0;
	font-family: var(--eos-font-mono);
	font-size: var(--eos-text-xs);
	letter-spacing: var(--eos-tracking-wider);
	color: var(--eos-text-subtle);
}
.eos-access-page__help a {
	color: var(--eos-accent);
	text-decoration: none;
	transition: color var(--eos-duration-fast) var(--eos-easing);
}
.eos-access-page__help a:hover,
.eos-access-page__help a:focus {
	color: var(--eos-accent-hover);
}

@media (max-width: 559px) {
	.eos-access-page__footer {
		justify-content: center;
		text-align: center;
	}
}

/* Fallback when elintra-os plugin is inactive — minimal honest message */
.eos-access-card--empty {
	max-width: 480px;
	width: 100%;
	padding: var(--eos-space-7);
	background: rgba(10, 10, 10, 0.85);
	border: 1px solid var(--eos-border);
	border-radius: var(--eos-radius);
	text-align: center;
	color: var(--eos-text);
}
.eos-access-card--empty .eos-access-card__label {
	font-family: var(--eos-font-mono);
	font-size: var(--eos-text-xs);
	letter-spacing: var(--eos-tracking-widest);
	text-transform: uppercase;
	color: var(--eos-text-muted);
	margin: 0 0 var(--eos-space-3);
}
.eos-access-card--empty .eos-access-card__label-accent {
	color: var(--eos-accent);
}
.eos-access-card--empty .eos-access-card__title {
	font-family: var(--eos-font-sans);
	font-size: clamp(1.5rem, 3vw, 2rem);
	font-weight: var(--eos-weight-semibold);
	margin: 0 0 var(--eos-space-4);
	color: var(--eos-text);
}
.eos-access-card--empty .eos-access-card__lead {
	color: var(--eos-text-muted);
	line-height: var(--eos-leading-relaxed);
	margin: 0;
}


/* ===================================================================
 * WORDPRESS ADMIN BAR — when an administrator views the public site,
 * keep the fixed admin bar from overlapping the header.
 * ============================================================== */

.admin-bar .eos-header {
	top: 32px;
}
@media (max-width: 782px) {
	.admin-bar .eos-header {
		top: 46px;
	}
}
