/* ============================================================================
   Orilogy Auth - header trigger, login popup, and the inline [orilogy_auth_form]

   Both the popup and the inline box share the .olg-ui scope. Everything is
   selected through it, which puts every rule at two-class specificity - enough
   to beat Hub's own button and input styling without !important. That styling
   is why the old tab pills both rendered dark: the theme was painting them.
   ========================================================================= */

/* ---------------------------------------------------------------------------
   Header trigger

   Three colour states: ink on inner pages, white on the homepage, white in the
   sticky header. Scoped to .is-stuck, not .admin-bar .is-stuck - .admin-bar is
   only present for signed-in admins, so customers would have missed out.
   ------------------------------------------------------------------------ */

.olg-auth-trigger.olg-auth-trigger {
	display: inline-flex;
	align-items: center;
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	font: inherit;
	line-height: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
	text-decoration: none;
	cursor: pointer;
	color: var(--olg-color, #241f20);
	transition: opacity .2s ease, color .2s ease;
}

body.home .olg-auth-trigger.olg-auth-trigger {
	color: var(--olg-color-home, #ffffff);
}

/* The stuck header is NOT a dark bar - measured, it is a translucent light
   overlay (rgba(87,94,85,.35)) sitting on the cream page. White here was only
   ever right while the header floated transparent over the dark hero image,
   which is the un-stuck homepage state handled above. Everywhere else white
   on light made the trigger invisible - worst on My Account, Cart and
   Checkout, which is where a customer most needs to find their own profile.
   Override with --olg-color-stuck if a genuinely dark sticky header is used. */
body .is-stuck .olg-auth-trigger.olg-auth-trigger,
body.home .is-stuck .olg-auth-trigger.olg-auth-trigger {
	color: var(--olg-color-stuck, #241f20);
}

.olg-auth-trigger.olg-auth-trigger:hover {
	opacity: .7;
}

.olg-auth-trigger.olg-auth-trigger:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 4px;
}

/* ---------------------------------------------------------------------------
   Shared shell
   ------------------------------------------------------------------------ */

.olg-ui {
	--olg-display: var(--e-global-typography-primary-font-family, Georgia, serif);
	--olg-sans: var(--e-global-typography-text-font-family, Helvetica, Arial, sans-serif);

	--olg-ink: var(--e-global-color-primary, #241f20);
	--olg-cream: var(--e-global-color-secondary, #f2ebde);
	--olg-forest: #183b19;
	--olg-red: #8c2f22;

	/* Roles, so the inverted variant only has to swap these four. */
	--olg-surface: var(--olg-cream);
	--olg-field: #fdfbf7;
	--olg-text: var(--olg-ink);
	--olg-on-accent: var(--olg-cream);
	--olg-accent: var(--olg-ink);

	--olg-muted: color-mix(in srgb, var(--olg-text) 62%, transparent);
	--olg-line: color-mix(in srgb, var(--olg-text) 20%, transparent);

	font-family: var(--olg-sans);
	color: var(--olg-text);
}

.olg-ui * {
	box-sizing: border-box;
}

/* Inverted: an ink panel for dropping onto a light page. */
.olg-ui.olg-invert {
	--olg-surface: var(--olg-ink);
	--olg-field: rgba(255, 255, 255, .06);
	--olg-text: var(--olg-cream);
	--olg-accent: var(--olg-cream);
	--olg-on-accent: var(--olg-ink);
}

/* ---------------------------------------------------------------------------
   Copy
   ------------------------------------------------------------------------ */

.olg-ui .olg-title {
	margin: 0 0 6px;
	font-family: var(--olg-display);
	font-weight: 300;
	font-size: 30px;
	line-height: 1.12;
	color: var(--olg-text);
}

.olg-ui .olg-lede {
	margin: 0 0 22px;
	font-size: 14px;
	line-height: 1.55;
	color: var(--olg-muted);
}

.olg-ui .olg-panel[hidden] {
	display: none;
}

/* ---------------------------------------------------------------------------
   Form
   ------------------------------------------------------------------------ */

.olg-ui .olg-label,
.olg-ui .olg-form label {
	display: block;
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 500;
	color: var(--olg-muted);
}

.olg-ui .olg-input,
.olg-ui .olg-form input[type="text"],
.olg-ui .olg-form input[type="email"],
.olg-ui .olg-form input[type="tel"],
.olg-ui .olg-form input[type="password"] {
	display: block;
	width: 100%;
	min-height: 48px;
	margin: 0 0 16px;
	padding: 12px 15px;
	background: var(--olg-field);
	border: 1px solid var(--olg-line);
	border-radius: 10px;
	box-shadow: none;
	font-family: inherit;
	font-size: 15px;
	color: var(--olg-text);
	transition: border-color .2s ease, box-shadow .2s ease;
}

.olg-ui .olg-form input:focus {
	outline: none;
	border-color: var(--olg-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--olg-accent) 18%, transparent);
}

.olg-ui .olg-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 2px 0 20px;
}

.olg-ui .olg-form label.olg-check {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 0;
	font-size: 13px;
	font-weight: 400;
	color: var(--olg-muted);
	cursor: pointer;
}

.olg-ui .olg-check input {
	width: 15px;
	height: 15px;
	min-height: 0;
	margin: 0;
	padding: 0;
	accent-color: var(--olg-accent);
}

.olg-ui .olg-small-link {
	font-size: 13px;
	color: var(--olg-muted);
	text-decoration: none;
	border-bottom: 1px solid var(--olg-line);
	transition: color .2s ease, border-color .2s ease;
}

.olg-ui .olg-small-link:hover {
	color: var(--olg-text);
	border-color: var(--olg-text);
}

.olg-ui .olg-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 50px;
	margin: 0;
	padding: 0 20px;
	background: var(--olg-accent);
	border: 0;
	border-radius: 999px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 500;
	letter-spacing: 0;
	text-transform: none;
	color: var(--olg-on-accent);
	cursor: pointer;
	transition: opacity .22s ease;
}

.olg-ui .olg-btn:hover {
	opacity: .86;
}

.olg-ui .olg-btn[disabled] {
	opacity: .6;
	cursor: default;
}

/* "Don't have an account yet? Register now" - replaces the old tab bar. */
.olg-ui .olg-swap {
	margin: 18px 0 0;
	text-align: center;
	font-size: 14px;
	color: var(--olg-muted);
}

.olg-ui .olg-swap-link {
	margin: 0 0 0 4px;
	padding: 0;
	background: none;
	border: 0;
	border-bottom: 1px solid currentColor;
	border-radius: 0;
	font: inherit;
	font-weight: 500;
	color: var(--olg-text);
	cursor: pointer;
	transition: opacity .2s ease;
}

.olg-ui .olg-swap-link:hover {
	opacity: .7;
}

.olg-ui .olg-alert {
	margin: 0 0 16px;
	padding: 12px 14px;
	background: color-mix(in srgb, var(--olg-red) 10%, transparent);
	border: 1px solid color-mix(in srgb, var(--olg-red) 45%, transparent);
	border-radius: 10px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--olg-text);
}

.olg-ui .olg-alert[hidden] {
	display: none;
}

.olg-ui .olg-form .woocommerce-form-row,
.olg-ui .olg-form .form-row {
	margin: 0 0 16px;
	padding: 0;
}

/* ---------------------------------------------------------------------------
   Inline box - [orilogy_auth_form]
   ------------------------------------------------------------------------ */

.olg-box {
	width: 100%;
	max-width: 460px;
	margin-inline: auto;
	padding: 34px 34px 30px;
	background: var(--olg-surface);
	border-radius: 18px;
}

/* The theme wrapper on /my-account/ forces full width on plain content divs
   (the same issue the account redesign hit), so reinforce the box here
   specifically rather than everywhere .olg-box is used. */
body.woocommerce-account .olg-box {
	max-width: 460px !important;
	margin-inline: auto !important;
	padding-top: 100px;
}

/* ---------------------------------------------------------------------------
   Popup
   ------------------------------------------------------------------------ */

.olg-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.olg-modal[hidden] {
	display: none;
}

.olg-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(20, 17, 16, .55);
	backdrop-filter: blur(3px);
	opacity: 0;
	transition: opacity .28s ease;
}

.olg-modal.is-open .olg-backdrop {
	opacity: 1;
}

.olg-dialog {
	position: relative;
	width: 100%;
	max-width: 430px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	padding: 34px 34px 30px;
	background: var(--olg-surface);
	border-radius: 18px;
	box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .5);
	opacity: 0;
	transform: translateY(12px) scale(.985);
	transition: opacity .3s ease, transform .34s cubic-bezier(.22, .61, .36, 1);
}

.olg-modal.is-open .olg-dialog {
	opacity: 1;
	transform: none;
}

/* Small and quiet - it was rendering as a big filled circle because the theme
   paints bare <button> elements. */
.olg-dialog .olg-close {
	position: absolute;
	top: 12px;
	right: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	min-height: 0;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 50%;
	box-shadow: none;
	font-size: 20px;
	line-height: 1;
	color: var(--olg-muted);
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease;
}

.olg-dialog .olg-close:hover {
	background: color-mix(in srgb, var(--olg-text) 8%, transparent);
	color: var(--olg-text);
}

html.olg-locked,
body.olg-locked {
	overflow: hidden;
}

/* ---------------------------------------------------------------------------
   Social login - Nextend Social Login buttons, restyled to the olg system.

   Nextend ships its own stylesheet and, when a custom button colour is set in
   its admin, inline styles on the anchors. The three visual properties below
   are therefore !important: an author !important beats an inline declaration,
   which is the only way to stop a Nextend colour setting from punching a blue
   Facebook slab through this box. Layout wins on specificity alone.

   The buttons are the quiet option here, not the loud one - outlined, sharing
   the pill radius of .olg-btn, so the store's own "Sign in" stays primary.
   ------------------------------------------------------------------------ */

.olg-ui .olg-social {
	margin: 0 0 20px;
}

.olg-ui .olg-social .nsl-container {
	margin: 0;
	padding: 0;
	text-align: left;
}

.olg-ui .olg-social .nsl-container-buttons {
	display: grid;
	gap: 10px;
	margin: 0;
	padding: 0;
}

.olg-ui .olg-social .nsl-container .nsl-button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	min-width: 0;
	min-height: 46px;
	margin: 0;
	padding: 0 18px;
	border-radius: 999px;
	box-shadow: none;
	text-decoration: none;
	overflow: hidden;
	background-color: var(--olg-field) !important;
	border: 1px solid var(--olg-line) !important;
	transition: border-color .2s ease, opacity .2s ease;
}

.olg-ui .olg-social .nsl-container .nsl-button:hover {
	border-color: var(--olg-accent) !important;
}

.olg-ui .olg-social .nsl-container .nsl-button-svg-container {
	flex: 0 0 auto;
	margin: 0;
	padding: 0;
}

.olg-ui .olg-social .nsl-container .nsl-button-svg-container svg {
	width: 19px;
	height: 19px;
}

.olg-ui .olg-social .nsl-container .nsl-button-label-container {
	flex: 0 1 auto;
	margin: 0;
	padding: 0;
	font-family: var(--olg-sans);
	font-size: 15px;
	font-weight: 500;
	letter-spacing: 0;
	text-transform: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--olg-text) !important;
}

/* Nextend's own divider, if a provider template ever prints one. */
.olg-ui .olg-social .nsl-separator {
	display: none;
}

.olg-ui .olg-social-or {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 18px 0 0;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--olg-muted);
}

.olg-ui .olg-social-or::before,
.olg-ui .olg-social-or::after {
	content: "";
	flex: 1 1 auto;
	height: 1px;
	background: var(--olg-line);
}

@media (max-width: 480px) {
	.olg-dialog,
	.olg-box {
		padding: 30px 22px 26px;
		border-radius: 16px;
	}

	.olg-ui .olg-title {
		font-size: 26px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.olg-backdrop,
	.olg-dialog {
		transition-duration: .01ms;
	}
}
