/* OG Ajax Login — popup, inline form, and trigger button. */

.ogal,
.ogal-modal,
.ogal-btn,
.ogal-slot {
	--ogal-ink: #1c2430;
	--ogal-muted: #5c6b7a;
	--ogal-line: #d5dee6;
	--ogal-bg: #ffffff;
	--ogal-soft: #f3f6f7;
	--ogal-accent: #0e6b67;
	--ogal-accent-hover: #0a5552;
	--ogal-danger: #9f2d2d;
	--ogal-danger-bg: #fdf2f2;
	--ogal-ok: #1d6b45;
	--ogal-ok-bg: #f1f8f4;
	color: var(--ogal-ink);
	font-family: inherit;
	line-height: 1.45;
	box-sizing: border-box;
}

.ogal[dir="rtl"],
.ogal-modal[dir="rtl"] {
	font-family: Tahoma, "Noto Naskh Arabic", "Noto Sans Arabic", sans-serif;
}

.ogal *,
.ogal-modal *,
.ogal-btn,
.ogal-slot * {
	box-sizing: border-box;
}

.ogal [hidden],
.ogal-modal[hidden],
.ogal-slot [hidden] {
	display: none !important;
}

html.ogal-noscroll,
html.ogal-noscroll body {
	overflow: hidden;
}

.ogal-modal {
	position: fixed;
	inset: 0;
	z-index: 1000000;
	display: grid;
	place-items: center;
	padding: 16px;
	opacity: 0;
	transition: opacity 0.16s ease;
	color-scheme: light;
}

.ogal-modal.is-open {
	opacity: 1;
}

.ogal-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(18, 28, 36, 0.56);
}

.ogal-modal__dialog {
	position: relative;
	z-index: 1;
	width: min(440px, 100%);
	max-height: min(760px, calc(100vh - 32px));
	overflow: auto;
	background: var(--ogal-bg);
	color: var(--ogal-ink);
	border-radius: 18px;
	box-shadow: 0 24px 60px rgba(20, 32, 41, 0.22);
	padding: 28px 24px 22px;
	transform: translateY(8px);
	transition: transform 0.16s ease;
}

.ogal-modal.is-open .ogal-modal__dialog {
	transform: none;
}

.ogal-modal__close {
	position: absolute;
	inset-inline-end: 10px;
	top: 10px;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--ogal-muted);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.ogal-modal__close:hover,
.ogal-modal__close:focus-visible {
	background: var(--ogal-soft);
	color: var(--ogal-ink);
}

.ogal-title {
	margin: 0;
	margin-bottom: 6px;
	margin-inline-end: 32px;
	font-size: 1.45rem;
	line-height: 1.25;
	font-weight: 700;
}

.ogal-lead,
.ogal-hint,
.ogal-privacy {
	margin: 0 0 16px;
	color: var(--ogal-muted);
	font-size: 0.95rem;
}

.ogal-message {
	margin: 0 0 14px;
	padding: 10px 12px;
	border-radius: 10px;
	background: var(--ogal-danger-bg);
	color: var(--ogal-danger);
	font-size: 0.92rem;
}

.ogal-message.is-success {
	background: var(--ogal-ok-bg);
	color: var(--ogal-ok);
}

.ogal-field {
	display: block;
	margin: 0 0 12px;
}

.ogal-field span {
	display: block;
	margin-bottom: 6px;
	font-size: 0.92rem;
	font-weight: 600;
}

.ogal-field input {
	width: 100%;
	height: 46px;
	padding: 0 12px;
	border: 1px solid var(--ogal-line);
	border-radius: 10px;
	background: #fff;
	color: var(--ogal-ink);
	font: inherit;
}

.ogal-control {
	position: relative;
	display: block;
}

.ogal-control input {
	padding-inline-end: 92px;
}

.ogal-toggle-password {
	position: absolute;
	inset-inline-end: 6px;
	top: 6px;
	height: 34px;
	padding: 0 10px;
	border: 0;
	border-radius: 8px;
	background: var(--ogal-soft);
	color: var(--ogal-ink);
	font: inherit;
	font-size: 0.82rem;
	cursor: pointer;
}

.ogal input:focus {
	outline: 2px solid transparent;
	border-color: var(--ogal-accent);
	box-shadow: 0 0 0 3px rgba(14, 107, 103, 0.2);
}

.ogal input.is-invalid {
	border-color: var(--ogal-danger);
	box-shadow: 0 0 0 3px rgba(159, 45, 45, 0.15);
}

.ogal-check {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0 0 14px;
	font-size: 0.92rem;
}

.ogal-check input {
	margin-top: 3px;
}

.ogal-submit,
.ogal-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 0 18px;
	border: 0;
	border-radius: 10px;
	background: var(--ogal-accent);
	color: #fff;
	font: inherit;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
}

.ogal-submit {
	width: 100%;
	position: relative;
}

.ogal-submit:hover,
.ogal-btn:hover,
.ogal-submit:focus-visible,
.ogal-btn:focus-visible {
	background: var(--ogal-accent-hover);
	color: #fff;
}

.ogal-btn--ghost {
	background: transparent;
	color: var(--ogal-accent);
	border: 1px solid var(--ogal-line);
}

.ogal-btn--ghost:hover,
.ogal-btn--ghost:focus-visible {
	background: var(--ogal-soft);
	color: var(--ogal-accent-hover);
}

.ogal-submit[aria-busy="true"] {
	cursor: progress;
}

.ogal-submit[aria-busy="true"] span {
	visibility: hidden;
}

.ogal-submit[aria-busy="true"]::after {
	content: "";
	position: absolute;
	width: 1em;
	height: 1em;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: ogal-spin 0.7s linear infinite;
}

.ogal-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px 16px;
	margin: 14px 0 0;
}

.ogal-switch {
	padding: 0;
	border: 0;
	background: none;
	color: var(--ogal-accent);
	font: inherit;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.ogal-switch:hover,
.ogal-switch:focus-visible {
	color: var(--ogal-accent-hover);
}

.ogal-social {
	display: grid;
	gap: 8px;
	margin-bottom: 14px;
}

.ogal-or {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 10px;
	margin: 4px 0 0;
	color: var(--ogal-muted);
	font-size: 0.85rem;
}

.ogal-or::before,
.ogal-or::after {
	content: "";
	height: 1px;
	background: var(--ogal-line);
}

.ogal-extra:empty {
	display: none;
}

.ogal-extra:not(:empty) {
	margin-bottom: 12px;
}

.ogal-account {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
}

.ogal-avatar {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	object-fit: cover;
	background: var(--ogal-soft);
}

.ogal-member {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.ogal-strength {
	display: grid;
	gap: 4px;
	margin: -4px 0 12px;
}

.ogal-strength__bar {
	display: block;
	height: 6px;
	border-radius: 999px;
	background: var(--ogal-line);
	position: relative;
	overflow: hidden;
}

.ogal-strength__bar::before {
	content: "";
	display: block;
	height: 100%;
	width: 20%;
	background: var(--ogal-danger);
}

.ogal-strength__bar[data-score="2"]::before {
	width: 45%;
	background: #b86e12;
}

.ogal-strength__bar[data-score="3"]::before {
	width: 70%;
	background: #2f7d32;
}

.ogal-strength__bar[data-score="4"]::before {
	width: 100%;
	background: var(--ogal-accent);
}

.ogal-strength__bar[data-score="5"]::before {
	width: 100%;
	background: var(--ogal-danger);
}

.ogal-strength__label {
	font-size: 0.82rem;
	color: var(--ogal-muted);
}

.ogal-hp {
	position: absolute !important;
	height: 1px;
	width: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	white-space: nowrap;
}

.ogal-privacy a {
	color: var(--ogal-accent);
}

@keyframes ogal-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.ogal-modal,
	.ogal-modal__dialog,
	.ogal-submit[aria-busy="true"]::after {
		transition: none;
		animation: none;
		transform: none;
	}
}
