/**
 * Glassmorphic member-login modal — same "Liquid Glass" material as the
 * header's frosted controls (css/header-footer.css .icpep-header__cta),
 * scaled up into a full dialog: heavy blur+saturate, a hairline light
 * border, and an inset top highlight that reads as a specular edge.
 * Colors/shadows/type all come from css/components.css's tokens — see
 * CLAUDE.md "Token Alignment".
 */

.icpep-login-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

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

.icpep-login-modal__overlay {
	position: absolute;
	inset: 0;
	background-color: rgba( 11, 19, 43, 0.4 );
	backdrop-filter: blur( 6px );
	-webkit-backdrop-filter: blur( 6px );
	opacity: 0;
	transition: opacity 0.28s ease;
}

.icpep-login-modal.is-open .icpep-login-modal__overlay {
	opacity: 1;
}

.icpep-login-modal__panel {
	position: relative;
	width: 100%;
	max-width: 400px;
	max-height: calc( 100vh - 48px );
	overflow-y: auto;
	padding: 2.75rem 2rem 2rem;
	background-color: rgba( 255, 255, 255, 0.72 );
	/* 20px, not 40px — the top of this site's documented Liquid Glass
	   blur range (12–20px, see CLAUDE.md) is 20px; this panel was blurring
	   at 2x every other frosted surface (header pill, member cards, nav)
	   for no functional reason, reading as a noticeably hazier material
	   than the rest of the glass hierarchy. */
	backdrop-filter: blur( 20px ) saturate( 180% );
	-webkit-backdrop-filter: blur( 20px ) saturate( 180% );
	border: 1px solid rgba( 255, 255, 255, 0.65 );
	border-radius: 32px;
	box-shadow:
		0 24px 60px -12px rgba( 11, 19, 43, 0.35 ),
		0 8px 24px -8px rgba( 11, 19, 43, 0.25 ),
		inset 0 1px 0 rgba( 255, 255, 255, 0.85 );
	opacity: 0;
	transform: scale( 0.92 ) translateY( 16px );
	transition: opacity 0.32s cubic-bezier( 0.34, 1.56, 0.64, 1 ), transform 0.32s cubic-bezier( 0.34, 1.56, 0.64, 1 );
}

.icpep-login-modal.is-open .icpep-login-modal__panel {
	opacity: 1;
	transform: scale( 1 ) translateY( 0 );
}

.icpep-login-modal.is-shake .icpep-login-modal__panel {
	animation: icpep-login-modal-shake 0.4s ease;
}

@keyframes icpep-login-modal-shake {
	0%, 100% { transform: scale( 1 ) translateX( 0 ); }
	20% { transform: scale( 1 ) translateX( -8px ); }
	40% { transform: scale( 1 ) translateX( 7px ); }
	60% { transform: scale( 1 ) translateX( -5px ); }
	80% { transform: scale( 1 ) translateX( 3px ); }
}

/*
 * #icpep-login-modal-prefixed, not just .icpep-login-modal__close: Hello
 * Elementor's reset.css has `[type="button"], [type="submit"], button {
 * border: 1px solid #cc3366; ... }`, which for a `[type="button"]` element
 * is (0,1,0) specificity — a tie with a single class selector that the
 * reset can win on load order. The id+class combinator here is (1,1,0),
 * which wins unconditionally. Same fix components.css documents for
 * .icpep-btn.icpep-btn--primary.
 */
#icpep-login-modal .icpep-login-modal__close {
	position: absolute;
	top: 18px;
	right: 18px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	flex-shrink: 0;
	color: var( --e-global-color-primary, #0b132b );
	background-color: rgba( 255, 255, 255, 0.55 );
	backdrop-filter: blur( 16px ) saturate( 180% );
	-webkit-backdrop-filter: blur( 16px ) saturate( 180% );
	border: 1px solid rgba( 255, 255, 255, 0.6 );
	border-radius: 9999px;
	box-shadow: 0 4px 14px rgba( 11, 19, 43, 0.1 ), inset 0 1px 0 rgba( 255, 255, 255, 0.7 );
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

/* flex-shrink:0 is load-bearing, not decorative: an inline SVG as the
   sole child of a flex container gets treated as having near-zero
   min-content width for shrink purposes, so the default flex-shrink:1
   crushes it down from the specified 16px to ~2px even though the 36px
   button has plenty of room — flex-basis:auto doesn't protect against
   that on its own. */
.icpep-login-modal__close svg {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

#icpep-login-modal .icpep-login-modal__close:hover,
#icpep-login-modal .icpep-login-modal__close:focus-visible {
	background-color: rgba( 255, 255, 255, 0.8 );
	transform: translateY( -1px );
	box-shadow: 0 6px 18px rgba( 11, 19, 43, 0.14 ), inset 0 1px 0 rgba( 255, 255, 255, 0.8 );
}

#icpep-login-modal .icpep-login-modal__close:focus-visible {
	outline: 2px solid var( --icpep-cyan-deep, #007ead );
	outline-offset: 2px;
}

.icpep-login-modal__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	margin: 0 0 1.25rem;
	color: #ffffff;
	background: linear-gradient( 145deg, var( --icpep-cyan-deep, #007ead ), var( --e-global-color-primary, #0b132b ) );
	border-radius: 16px;
	box-shadow: 0 8px 20px -6px rgba( 0, 122, 173, 0.55 ), inset 0 1px 0 rgba( 255, 255, 255, 0.35 );
}

.icpep-login-modal__badge svg {
	width: 24px;
	height: 24px;
	flex-shrink: 0;
}

.icpep-login-modal__title {
	margin: 0 0 0.35rem;
	font-family: var( --e-global-typography-primary-font-family, 'Inter' ), sans-serif;
	font-weight: 700;
	font-size: var( --icpep-fs-md );
	color: var( --e-global-color-primary, #0b132b );
}

.icpep-login-modal__subtitle {
	margin: 0 0 1.5rem;
	font-family: var( --e-global-typography-text-font-family, 'Inter' ), sans-serif;
	font-size: var( --icpep-fs-sm );
	color: var( --e-global-color-text, #1f2937 );
	opacity: 0.75;
}

.icpep-login-modal__error {
	margin: 0 0 1.25rem;
	padding: 0.65em 0.9em;
	font-family: var( --e-global-typography-text-font-family, 'Inter' ), sans-serif;
	font-size: var( --icpep-fs-sm );
	font-weight: 600;
	color: #8a1538;
	background-color: rgba( 138, 21, 56, 0.08 );
	border: 1px solid rgba( 138, 21, 56, 0.2 );
	border-radius: 12px;
}

.icpep-login-modal__error[hidden] {
	display: none;
}

.icpep-login-modal__form {
	display: flex;
	flex-direction: column;
	gap: 1.1rem;
}

.icpep-login-modal__honeypot {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	white-space: nowrap;
	border: 0;
}

.icpep-login-modal__field {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.icpep-login-modal__field label {
	font-family: var( --e-global-typography-text-font-family, 'Inter' ), sans-serif;
	font-weight: 600;
	font-size: var( --icpep-fs-sm );
	color: var( --e-global-color-primary, #0b132b );
}

.icpep-login-modal__field input {
	width: 100%;
	font-family: var( --e-global-typography-text-font-family, 'Inter' ), sans-serif;
	font-size: var( --icpep-fs-base );
	color: var( --e-global-color-text, #1f2937 );
	background-color: rgba( 255, 255, 255, 0.6 );
	border: 1.5px solid rgba( 226, 232, 240, 0.9 );
	border-radius: 14px;
	padding: 0.75em 0.9em;
	min-height: 50px;
	transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.icpep-login-modal__field input:hover {
	border-color: rgba( 0, 163, 224, 0.45 );
}

.icpep-login-modal__field input:focus-visible {
	outline: none;
	background-color: #ffffff;
	border-color: var( --icpep-cyan-deep );
	box-shadow: 0 0 0 4px rgba( 0, 163, 224, 0.15 );
}

.icpep-login-modal__password-wrap {
	position: relative;
	display: flex;
}

.icpep-login-modal__password-wrap input {
	padding-right: 3rem;
}

/* #icpep-login-modal-prefixed for the same reset.css specificity-tie
   reason as .icpep-login-modal__close above. */
#icpep-login-modal .icpep-login-modal__password-toggle {
	position: absolute;
	top: 50%;
	right: 6px;
	transform: translateY( -50% );
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	color: var( --e-global-color-text, #1f2937 );
	opacity: 0.6;
	background: transparent;
	border: 0;
	border-radius: 9999px;
	cursor: pointer;
	transition: opacity 0.18s ease, background-color 0.18s ease;
}

.icpep-login-modal__password-toggle svg {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}

#icpep-login-modal .icpep-login-modal__password-toggle:hover {
	opacity: 1;
	background-color: rgba( 0, 163, 224, 0.1 );
}

#icpep-login-modal .icpep-login-modal__password-toggle:focus-visible {
	opacity: 1;
	outline: 2px solid var( --icpep-cyan-deep, #007ead );
	outline-offset: 2px;
}

.icpep-login-modal__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: -0.25rem;
}

.icpep-login-modal__remember {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-family: var( --e-global-typography-text-font-family, 'Inter' ), sans-serif;
	font-size: var( --icpep-fs-xs );
	color: var( --e-global-color-text, #1f2937 );
	cursor: pointer;
}

.icpep-login-modal__remember input {
	width: 18px;
	height: 18px;
	accent-color: var( --icpep-cyan-deep, #007ead );
	cursor: pointer;
}

.icpep-login-modal__forgot {
	font-family: var( --e-global-typography-text-font-family, 'Inter' ), sans-serif;
	font-size: var( --icpep-fs-xs );
	font-weight: 600;
	color: var( --icpep-cyan-deep, #007ead );
	text-decoration: none;
}

.icpep-login-modal__forgot:hover,
.icpep-login-modal__forgot:focus-visible {
	text-decoration: underline;
}

.icpep-login-modal__submit {
	position: relative;
	width: 100%;
	margin-top: 0.35rem;
}

.icpep-login-modal__spinner {
	display: none;
	width: 18px;
	height: 18px;
	margin-left: 0.6em;
	border: 2px solid rgba( 255, 255, 255, 0.4 );
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: icpep-login-modal-spin 0.7s linear infinite;
}

.icpep-login-modal.is-loading .icpep-login-modal__spinner {
	display: inline-block;
}

.icpep-login-modal.is-loading .icpep-login-modal__submit-label {
	opacity: 0.7;
}

@keyframes icpep-login-modal-spin {
	to { transform: rotate( 360deg ); }
}

@media ( max-width: 480px ) {
	.icpep-login-modal__panel {
		padding: 2.25rem 1.5rem 1.75rem;
		border-radius: 26px;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.icpep-login-modal__overlay,
	.icpep-login-modal__panel,
	.icpep-login-modal__close,
	.icpep-login-modal__password-toggle {
		transition: none;
	}

	.icpep-login-modal__panel {
		transform: none;
	}

	.icpep-login-modal.is-shake .icpep-login-modal__panel {
		animation: none;
	}
}

@media ( prefers-reduced-transparency: reduce ) {
	.icpep-login-modal__overlay {
		background-color: rgba( 11, 19, 43, 0.7 );
		backdrop-filter: none;
		-webkit-backdrop-filter: none;
	}

	.icpep-login-modal__panel {
		background-color: #ffffff;
		backdrop-filter: none;
		-webkit-backdrop-filter: none;
	}
}

body.icpep-login-modal-open {
	overflow: hidden;
}
