/**
 * Internal Portal System — premium login UI.
 * Scoped under .ips-portal / .ips-portal-stage so it never bleeds into
 * Elementor or theme layouts. Uses CSS variables for easy white-labelling.
 */

.ips-portal,
.ips-portal-stage {
	--ips-bg: #0a0c10;
	--ips-bg-2: #11141b;
	--ips-card: #141821;
	--ips-card-2: #1a1f2b;
	--ips-line: rgba(255, 255, 255, 0.08);
	--ips-line-strong: rgba(255, 255, 255, 0.16);
	--ips-fg: #eef2f8;
	--ips-mute: #9aa3b2;
	--ips-accent: #d40511;
	--ips-accent-2: #ff3b46;
	--ips-ok: #1faa59;
	--ips-warn: #e0a106;
	--ips-radius: 16px;
	--ips-radius-sm: 10px;
	--ips-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---- Full-screen stage (single template) ---------------------------------- */
body.ips-portal-page {
	margin: 0;
	background: var(--ips-bg);
}
.ips-portal-stage {
	position: relative;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 22px;
	padding: 40px 20px;
	box-sizing: border-box;
	font-family: var(--ips-font);
	color: var(--ips-fg);
	overflow: hidden;
}
.ips-portal-stage__bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	background:
		radial-gradient(1200px 600px at 80% -10%, rgba(212, 5, 17, 0.18), transparent 60%),
		radial-gradient(900px 500px at 0% 110%, rgba(60, 80, 160, 0.14), transparent 55%),
		linear-gradient(180deg, var(--ips-bg), var(--ips-bg-2));
}
.ips-portal-stage__bg::after {
	content: "";
	position: absolute;
	inset: 0;
	background-image: linear-gradient(var(--ips-line) 1px, transparent 1px),
		linear-gradient(90deg, var(--ips-line) 1px, transparent 1px);
	background-size: 46px 46px;
	opacity: 0.25;
	mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 75%);
	-webkit-mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 75%);
}
.ips-portal-stage > .ips-portal,
.ips-portal-stage__copy {
	position: relative;
	z-index: 1;
}
.ips-portal-stage__copy {
	color: var(--ips-mute);
	font: 400 12px/1.5 var(--ips-font);
	letter-spacing: 0.02em;
}

/* ---- Card ----------------------------------------------------------------- */
.ips-portal {
	font-family: var(--ips-font);
	color: var(--ips-fg);
	width: 100%;
	max-width: 440px;
	margin: 0 auto;
}
.ips-portal *,
.ips-portal *::before,
.ips-portal *::after {
	box-sizing: border-box;
}
.ips-portal__card {
	position: relative;
	background: linear-gradient(180deg, var(--ips-card-2), var(--ips-card));
	border: 1px solid var(--ips-line);
	border-radius: var(--ips-radius);
	padding: 34px 32px 26px;
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.04) inset,
		0 30px 60px -24px rgba(0, 0, 0, 0.7);
}
.ips-portal__card::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	right: 0;
	height: 3px;
	border-radius: var(--ips-radius) var(--ips-radius) 0 0;
	background: linear-gradient(90deg, var(--ips-accent), var(--ips-accent-2));
}

/* ---- Header --------------------------------------------------------------- */
.ips-portal__head {
	text-align: center;
	margin-bottom: 22px;
}
.ips-portal__logo {
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 44px;
	margin-bottom: 14px;
}
.ips-portal__logo-img,
.ips-portal__logo img,
.ips-portal__logo .custom-logo {
	max-height: 46px;
	width: auto;
}
.ips-portal__logo-text {
	font-weight: 800;
	font-size: 20px;
	letter-spacing: 0.04em;
}
.ips-portal__title {
	font-size: 23px;
	font-weight: 700;
	line-height: 1.2;
	margin: 6px 0 0;
	letter-spacing: -0.01em;
}
.ips-portal__desc {
	margin: 10px auto 0;
	max-width: 34ch;
	color: var(--ips-mute);
	font-size: 14px;
	line-height: 1.55;
}

/* ---- Access badge --------------------------------------------------------- */
.ips-badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 4px 10px;
	border-radius: 999px;
	border: 1px solid var(--ips-line-strong);
	color: var(--ips-mute);
	background: rgba(255, 255, 255, 0.03);
}
.ips-badge--super-admin,
.ips-badge--director-only { color: #ffd6d8; border-color: rgba(212,5,17,.5); background: rgba(212,5,17,.12); }
.ips-badge--manager-only { color: #ffe2ad; border-color: rgba(224,161,6,.45); background: rgba(224,161,6,.12); }
.ips-badge--public-login,
.ips-badge--customer-access { color: #bfe6cd; border-color: rgba(31,170,89,.45); background: rgba(31,170,89,.12); }

/* ---- Alerts / maintenance / 2FA ------------------------------------------- */
.ips-portal__alert {
	margin: 0 0 18px;
	padding: 12px 14px;
	border-radius: var(--ips-radius-sm);
	border: 1px solid rgba(212, 5, 17, 0.4);
	background: rgba(212, 5, 17, 0.12);
	color: #ffd6d8;
	font-size: 13.5px;
	line-height: 1.45;
}
.ips-portal__alert--ok {
	border-color: rgba(31, 170, 89, 0.45);
	background: rgba(31, 170, 89, 0.12);
	color: #c7f0d6;
}
.ips-portal__maintenance {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 16px;
	border-radius: var(--ips-radius-sm);
	border: 1px solid rgba(224, 161, 6, 0.4);
	background: rgba(224, 161, 6, 0.1);
	color: #ffe6b0;
	font-size: 14px;
	line-height: 1.5;
}
.ips-portal__maintenance-icon::before { content: "\26A0"; font-size: 18px; }
.ips-portal__twofa-note {
	margin: 0 0 16px;
	font-size: 13px;
	color: var(--ips-mute);
	text-align: center;
}

/* ---- Fields --------------------------------------------------------------- */
.ips-field { margin-bottom: 16px; }
.ips-field label {
	display: block;
	font-size: 12.5px;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--ips-mute);
	margin-bottom: 7px;
}
.ips-field input[type="text"],
.ips-field input[type="email"],
.ips-field input[type="password"] {
	width: 100%;
	height: 48px;
	padding: 0 14px;
	color: var(--ips-fg);
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid var(--ips-line-strong);
	border-radius: var(--ips-radius-sm);
	font-size: 15px;
	font-family: inherit;
	transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
	-webkit-appearance: none;
	appearance: none;
}
.ips-field input::placeholder { color: rgba(154, 163, 178, 0.6); }
.ips-field input:focus {
	outline: none;
	border-color: var(--ips-accent-2);
	box-shadow: 0 0 0 3px rgba(212, 5, 17, 0.22);
	background: rgba(255, 255, 255, 0.05);
}
.ips-field--row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.ips-field__pw { position: relative; }
.ips-field__pw input { padding-right: 46px; }
.ips-field__pw-toggle {
	position: absolute;
	right: 6px;
	top: 50%;
	transform: translateY(-50%);
	width: 36px;
	height: 36px;
	border: 0;
	background: transparent;
	cursor: pointer;
	border-radius: 8px;
}
.ips-field__pw-toggle span::before {
	content: "\1F441";
	font-size: 16px;
	opacity: 0.7;
}
.ips-field__pw-toggle[aria-pressed="true"] span::before { opacity: 1; }
.ips-field__pw-toggle:hover { background: rgba(255, 255, 255, 0.06); }

/* ---- Remember / forgot ---------------------------------------------------- */
.ips-check {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13.5px;
	color: var(--ips-mute);
	cursor: pointer;
	margin: 0;
}
.ips-check input { width: 16px; height: 16px; accent-color: var(--ips-accent); }
.ips-portal__forgot {
	font-size: 13.5px;
	color: var(--ips-accent-2);
	text-decoration: none;
}
.ips-portal__forgot:hover { text-decoration: underline; }

/* ---- Submit --------------------------------------------------------------- */
.ips-portal__captcha { display: flex; justify-content: center; }
.ips-portal__submit {
	position: relative;
	width: 100%;
	height: 50px;
	margin-top: 6px;
	border: 0;
	border-radius: var(--ips-radius-sm);
	background: linear-gradient(180deg, var(--ips-accent-2), var(--ips-accent));
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.02em;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	transition: transform 0.12s ease, box-shadow 0.18s ease, opacity 0.18s ease;
	box-shadow: 0 10px 26px -10px rgba(212, 5, 17, 0.7);
}
.ips-portal__submit:hover { transform: translateY(-1px); }
.ips-portal__submit:active { transform: translateY(0); }
.ips-portal__submit:disabled { opacity: 0.7; cursor: progress; }
.ips-portal__submit:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35), 0 10px 26px -10px rgba(212, 5, 17, 0.7);
}
.ips-portal__spinner {
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.45);
	border-top-color: #fff;
	border-radius: 50%;
	display: none;
	animation: ips-spin 0.7s linear infinite;
}
.ips-portal.is-loading .ips-portal__spinner { display: inline-block; }
@keyframes ips-spin { to { transform: rotate(360deg); } }

/* ---- Footer / security notice -------------------------------------------- */
.ips-portal__foot { margin-top: 20px; }
.ips-portal__security {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding-top: 16px;
	border-top: 1px solid var(--ips-line);
	color: var(--ips-mute);
	font-size: 11.5px;
	line-height: 1.5;
}
.ips-portal__lock::before { content: "\1F512"; font-size: 13px; }

/* ---- Accessibility / motion ---------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.ips-portal__spinner { animation-duration: 1.4s; }
	.ips-portal__submit { transition: none; }
}

/* ---- Responsive ----------------------------------------------------------- */
@media (max-width: 480px) {
	.ips-portal__card { padding: 26px 20px 22px; border-radius: 14px; }
	.ips-portal__title { font-size: 21px; }
	.ips-portal-stage { padding: 24px 14px; }
}

/* ---- Admin notice (invalid shortcode id, editors only) -------------------- */
.ips-notice {
	padding: 10px 14px;
	border-left: 3px solid #d40511;
	background: #fff4f4;
	color: #7a1016;
	font-size: 13px;
}
