/* PG Easy Login — tabbed Login / Sign Up card.
   Palette sampled from the reference design:
   maroon #900000 · gold #cea22d · cream #fafad7 */

.pgel-wrap {
	--pgel-primary: #900000;
	--pgel-primary-dark: #7a0000;
	--pgel-gold: #cea22d;
	--pgel-cream: #fafad7;
	--pgel-border: #cea22d;
	--pgel-radius: 10px;
	max-width: 400px;
	margin: 0 auto;
	font-family: inherit;
	line-height: 1.4;
}

.pgel-formcard {
	background: var(--pgel-cream);
	border: 2px solid var(--pgel-primary);
	border-radius: 12px;
	padding: 20px 18px 22px;
	box-shadow: 0 6px 24px rgba(120, 20, 10, 0.12);
	box-sizing: border-box;
}

/* Tabs */
.pgel-tabs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	border: 2px solid var(--pgel-primary);
	border-radius: var(--pgel-radius);
	overflow: hidden;
	margin: 0 0 18px;
}

.pgel-tab {
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	background: transparent;
	color: var(--pgel-primary);
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	padding: 11px 8px;
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
}

.pgel-tab:hover {
	background: rgba(144, 0, 0, 0.08);
}

.pgel-tab.active {
	background: var(--pgel-primary);
	color: var(--pgel-cream);
	cursor: default;
	font-weight: 700;
	box-shadow: inset 0 -3px 0 var(--pgel-gold);
}

.pgel-tab:focus-visible {
	outline: 2px dashed var(--pgel-primary);
	outline-offset: -5px;
}

/* Panels */
.pgel-panel {
	display: none;
}

.pgel-panel.active {
	display: block;
	animation: pgelFade 0.25s ease;
}

@keyframes pgelFade {
	from { opacity: 0; transform: translateY(4px); }
	to { opacity: 1; transform: none; }
}

/* Status message */
.pgel-msg {
	display: block;
	border-radius: 8px;
	padding: 10px 13px;
	margin: 0 0 14px;
	font-size: 14px;
	font-weight: 500;
}

.pgel-msg[hidden] {
	display: none;
}

.pgel-msg.error {
	background: #fdecea;
	color: var(--pgel-primary);
	border: 1px solid #eec0b8;
}

.pgel-msg.success {
	background: #e9f7ec;
	color: #1e6b34;
	border: 1px solid #bfe5c9;
}

/* Forgot-password panel */
.pgel-lost-text {
	color: #5a4a3a;
	font-size: 15px;
	line-height: 1.55;
	margin: 2px 0 16px;
}

.pgel-back-row {
	margin: 14px 0 0;
	text-align: center;
}

/* Fields */
.pgel-field {
	display: flex;
	align-items: stretch;
	background: #fff;
	border: 1.5px solid var(--pgel-border);
	border-radius: 9px;
	margin: 0 0 14px;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.pgel-field:focus-within {
	border-color: var(--pgel-primary);
	box-shadow: 0 0 0 3px rgba(144, 0, 0, 0.12);
}

.pgel-ico {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	margin: 4px;
	border-radius: 7px;
	background: var(--pgel-gold);
	color: #fff;
}

.pgel-ico .pgel-svg {
	width: 19px;
	height: 19px;
}

.pgel-field input {
	flex: 1 1 auto;
	min-width: 0;
	border: 0;
	outline: 0;
	background: transparent;
	padding: 13px 12px 13px 10px;
	font-size: 15px;
	color: #333;
	font-family: inherit;
}

.pgel-field.pgel-plain input {
	padding-left: 14px;
}

.pgel-field input::placeholder {
	color: #8f8f8f;
	opacity: 1;
}

/* Eye (password visibility) toggle */
.pgel-eye {
	border: 0;
	background: none;
	padding: 0 12px;
	cursor: pointer;
	color: #4a4a4a;
	display: flex;
	align-items: center;
}

.pgel-eye .pgel-svg {
	width: 20px;
	height: 20px;
}

.pgel-eye:hover {
	color: var(--pgel-primary);
}

.pgel-eye .i-eye-off {
	display: none;
}

.pgel-eye.showing .i-eye {
	display: none;
}

.pgel-eye.showing .i-eye-off {
	display: block;
}

/* Remember me / forgot password row */
.pgel-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin: 2px 2px 0;
	font-size: 14px;
	font-weight: 600;
}

.pgel-remember {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	cursor: pointer;
	color: var(--pgel-primary);
}

.pgel-remember input {
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: var(--pgel-primary);
	cursor: pointer;
}

.pgel-forgot {
	color: var(--pgel-primary);
	text-decoration: none;
	font-weight: 600;
}

.pgel-forgot:hover,
.pgel-forgot:focus {
	color: var(--pgel-primary-dark);
	text-decoration: underline;
}

/* Country code select */
.pgel-select-field {
	position: relative;
}

/* Country code + phone number share one line */
.pgel-phone-row {
	display: flex;
	align-items: stretch;
	gap: 10px;
}

.pgel-phone-row .pgel-select-field {
	flex: 0 0 44%;
	margin: 0 0 14px;
}

.pgel-phone-row .pgel-field.pgel-plain {
	flex: 1 1 0;
	min-width: 0;
	margin: 0 0 14px;
}

.pgel-select-field select {
	flex: 1 1 auto;
	min-width: 0;
	border: 0;
	outline: 0;
	background: transparent;
	appearance: none;
	-webkit-appearance: none;
	padding: 13px 36px 13px 14px;
	font-size: 15px;
	color: #333;
	cursor: pointer;
	font-family: inherit;
}

.pgel-select-field::after {
	content: "";
	position: absolute;
	right: 15px;
	top: 50%;
	width: 8px;
	height: 8px;
	border-right: 2px solid #777;
	border-bottom: 2px solid #777;
	transform: translateY(-70%) rotate(45deg);
	pointer-events: none;
}

/* Submit button */
.pgel-submit {
	display: block;
	width: calc(100% - 16px);
	margin: 20px 8px 4px;
	padding: 13px 16px;
	border: 0;
	border-radius: 9px;
	background: var(--pgel-primary);
	color: var(--pgel-cream);
	font-family: inherit;
	font-size: 17px;
	font-weight: 700;
	letter-spacing: 0.2px;
	cursor: pointer;
	position: relative;
	/* Never scaled, stretched or nudged — not by a theme, not by any state.
	   Success feedback works purely through background color, so the button's
	   geometry is frozen: transform plus the independent scale / translate /
	   rotate properties are all disabled, so no stylesheet can animate the
	   button's size or position. */
	transform: none !important;
	scale: none !important;
	translate: none !important;
	rotate: none !important;
	transition: background 0.2s;
}

.pgel-submit:hover {
	background: var(--pgel-primary-dark);
}

.pgel-submit:focus-visible {
	outline: 2px solid var(--pgel-gold);
	outline-offset: 2px;
}

.pgel-submit[disabled] {
	opacity: 0.75;
	cursor: progress;
}

/* Gated button (e.g. "Email Reset Link" before a valid e-mail is typed). */
.pgel-submit.pgel-btn-locked {
	opacity: 0.55;
	cursor: not-allowed;
}

/* No spinner pseudo-element: anything inserted inline with the label can
   make it wrap to a second line on some cards, which reads as "the button
   grows". The busy state is shown by dimming the button, the progress
   cursor and the changing label — geometry stays identical. */
/* Logged-in state */
.pgel-hello {
	margin: 4px 2px 14px;
	font-size: 15px;
	color: #5c1010;
}

.pgel-logout {
	text-align: center;
	text-decoration: none;
}

/* Honeypot (never visible) */
.pgel-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden;
}

/* Small screens */
@media (max-width: 420px) {
	.pgel-formcard {
		padding: 16px 12px 18px;
	}

	.pgel-tab {
		font-size: 15px;
	}

	.pgel-submit {
		width: 100%;
		margin-left: 0;
		margin-right: 0;
	}

	.pgel-phone-row {
		gap: 8px;
	}

	.pgel-phone-row .pgel-select-field {
		flex-basis: 46%;
	}

	.pgel-phone-row .pgel-select-field select {
		padding: 13px 24px 13px 10px;
	}
}

/* Captcha — styled like the other fields: white on gold, same radii/ring.
   Math row: gold shield block · maroon question · answer box · ↻ refresh. */
.pgel-captcha-row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 14px;
	padding: 4px;
	border: 1.5px solid var(--pgel-border);
	border-radius: 9px;
	background: #fff;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.pgel-captcha-row:focus-within {
	border-color: var(--pgel-primary);
	box-shadow: 0 0 0 3px rgba(144, 0, 0, 0.12);
}

.pgel-cap-ico {
	flex: 0 0 36px;
	width: 36px;
	height: 36px;
	margin: 0;
}

.pgel-cap-ico .pgel-svg {
	width: 17px;
	height: 17px;
}

.pgel-captcha-q {
	flex: 1 1 auto;
	font-weight: 700;
	color: var(--pgel-primary);
	font-size: 15px;
	white-space: nowrap;
}

.pgel-captcha-in {
	flex: 0 0 84px;
	width: 84px;
	margin: 0;
	padding: 9px 6px;
	border: 0;
	border-left: 1.5px solid var(--pgel-border);
	border-radius: 0;
	outline: 0;
	background: transparent;
	font-size: 15px;
	font-weight: 700;
	text-align: center;
	color: #333;
	font-family: inherit;
}

.pgel-captcha-in::placeholder {
	color: #8f8f8f;
	opacity: 1;
	font-weight: 600;
}

.pgel-cap-refresh {
	appearance: none;
	-webkit-appearance: none;
	flex: 0 0 auto;
	width: 30px;
	height: 30px;
	margin-right: 2px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--pgel-primary);
	font-size: 16px;
	line-height: 1;
	padding: 0;
	cursor: pointer;
	transition: background 0.2s;
}

.pgel-cap-refresh:hover {
	background: rgba(144, 0, 0, 0.08);
}

/* Remote captcha widgets (reCAPTCHA v2 / Turnstile) */
.pgel-captcha-box {
	margin: 0 0 14px;
	display: flex;
	justify-content: flex-start;
}

@media (max-width: 360px) {
	.pgel-captcha-q {
		font-size: 14px;
	}

	.pgel-captcha-in {
		flex: 0 0 62px;
		width: 62px;
	}

	.pgel-cap-ico {
		display: none;
	}
}

/* Popup modal — opens from any element with class "pgel-card" */
.pgel-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 18px;
}

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

body.pgel-modal-open {
	overflow: hidden;
}

.pgel-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(52, 34, 12, 0.55);
	animation: pgelFade 0.2s ease;
}

.pgel-modal-box {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 430px;
	animation: pgelPop 0.22s ease;
}

.pgel-modal-box .pgel-wrap {
	max-width: none;
	margin: 0;
}

.pgel-modal-x {
	position: absolute;
	top: -14px;
	right: -14px;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 2px solid var(--pgel-primary, #900000);
	border-radius: 50%;
	background: #fff;
	color: var(--pgel-primary, #900000);
	font-size: 20px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
	z-index: 2;
}

.pgel-modal-x:hover {
	background: var(--pgel-primary, #900000);
	color: #fff;
}

/* While the card HTML is being fetched, the whole box — × button included —
   stays hidden, so the close button and the form always appear together. */
.pgel-modal.pgel-modal-loading .pgel-modal-box {
	display: none;
}

@keyframes pgelPop {
	from { opacity: 0; transform: translateY(14px) scale(0.97); }
	to { opacity: 1; transform: none; }
}

@media (max-width: 420px) {
	.pgel-modal {
		padding: 12px;
	}
}
