/**
 * Checkout quick sign-in strip + modal (WCIGR).
 */

html.wcigr-auth-modal-open,
html.wcigr-auth-modal-open body {
	overflow: hidden;
}

/* My Account login page */
body.woocommerce-account.wcigr-myaccount-auth-active .wcigr-checkout-auth-strip--account {
	margin-bottom: 1.25rem;
}

body.woocommerce-account.wcigr-app-webview .woocommerce-form-login,
body.woocommerce-account.wcigr-app-webview .woocommerce-form-register {
	padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

/* Android / WebView: comfortable taps, reduce iOS input zoom */
body.wcigr-app-webview .wcigr-auth-input,
body.wcigr-app-webview .wcigr-auth-btn {
	font-size: 16px;
	min-height: 44px;
}

body.wcigr-app-webview .wcigr-auth-modal__panel {
	margin-bottom: max(12px, env(safe-area-inset-bottom));
	padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
}

body.wcigr-app-webview .wcigr-checkout-auth-strip__btn {
	min-height: 44px;
	-webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
}

/* --- Page polish when strip is shown --- */
body.wcigr-checkout-auth-active.woocommerce-checkout .woocommerce {
	--wcigr-auth-accent: #2563eb;
	--wcigr-auth-accent2: #7c3aed;
	--wcigr-auth-radius: 14px;
}

body.wcigr-checkout-auth-active.woocommerce-checkout #customer_details,
body.wcigr-checkout-auth-active.woocommerce-checkout #order_review,
body.wcigr-checkout-auth-active.woocommerce-checkout .woocommerce-checkout-review-order {
	border-radius: var(--wcigr-auth-radius, 14px);
}

/* --- Top strip --- */
.wcigr-checkout-auth-strip {
	margin: 0 0 1.25rem;
	padding: 0;
	background: linear-gradient(135deg, #0f172a 0%, #1e293b 45%, #312e81 100%);
	border-radius: 14px;
	box-shadow: 0 10px 40px rgba(15, 23, 42, 0.25);
	color: #f8fafc;
	overflow: hidden;
	position: relative;
}

.wcigr-checkout-auth-strip::after {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse 80% 60% at 100% 0%, rgba(99, 102, 241, 0.35), transparent 55%);
	pointer-events: none;
}

.wcigr-checkout-auth-strip__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem 1.25rem;
	position: relative;
	z-index: 1;
	flex-wrap: wrap;
}

.wcigr-checkout-auth-strip__text {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	min-width: 0;
}

.wcigr-checkout-auth-strip__title {
	font-weight: 700;
	font-size: 1.05rem;
	letter-spacing: -0.02em;
}

.wcigr-checkout-auth-strip__sub {
	font-size: 0.85rem;
	opacity: 0.88;
	line-height: 1.35;
}

.wcigr-checkout-auth-strip__btn {
	appearance: none;
	border: none;
	cursor: pointer;
	font-weight: 600;
	font-size: 0.9rem;
	padding: 0.65rem 1.25rem;
	border-radius: 999px;
	background: #fff;
	color: #1e1b4b;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	flex-shrink: 0;
}

.wcigr-checkout-auth-strip__btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.wcigr-checkout-auth-strip__btn:focus {
	outline: 2px solid #c7d2fe;
	outline-offset: 2px;
}

/* --- Modal --- */
.wcigr-auth-modal[hidden] {
	display: none !important;
}

.wcigr-auth-modal:not([hidden]) {
	display: flex;
	position: fixed;
	inset: 0;
	z-index: 100000;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	box-sizing: border-box;
}

.wcigr-auth-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	backdrop-filter: blur(6px);
}

.wcigr-auth-modal__panel {
	position: relative;
	width: 100%;
	max-width: 420px;
	background: #fff;
	border-radius: 18px;
	box-shadow: 0 24px 80px rgba(15, 23, 42, 0.35);
	padding: 1.75rem 1.5rem 1.5rem;
	animation: wcigrAuthPop 0.28s ease;
}

@keyframes wcigrAuthPop {
	from {
		opacity: 0;
		transform: scale(0.96) translateY(8px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.wcigr-auth-modal__close {
	position: absolute;
	top: 0.65rem;
	right: 0.65rem;
	width: 2.25rem;
	height: 2.25rem;
	border: none;
	background: #f1f5f9;
	border-radius: 999px;
	font-size: 1.35rem;
	line-height: 1;
	cursor: pointer;
	color: #64748b;
	transition: background 0.15s, color 0.15s;
}

.wcigr-auth-modal__close:hover {
	background: #e2e8f0;
	color: #0f172a;
}

.wcigr-auth-modal__header {
	margin-bottom: 1.25rem;
	padding-right: 2rem;
}

.wcigr-auth-modal__title {
	margin: 0 0 0.35rem;
	font-size: 1.35rem;
	font-weight: 800;
	letter-spacing: -0.03em;
	color: #0f172a;
}

.wcigr-auth-modal__lead {
	margin: 0;
	font-size: 0.9rem;
	color: #64748b;
	line-height: 1.45;
}

.wcigr-auth-modal__divider {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin: 1rem 0;
	color: #94a3b8;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-weight: 600;
}

.wcigr-auth-modal__divider::before,
.wcigr-auth-modal__divider::after {
	content: "";
	flex: 1;
	height: 1px;
	background: #e2e8f0;
}

/* Buttons */
.wcigr-auth-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.65rem;
	width: 100%;
	padding: 0.75rem 1rem;
	border-radius: 12px;
	font-weight: 600;
	font-size: 0.95rem;
	text-decoration: none;
	border: none;
	cursor: pointer;
	transition: transform 0.12s ease, box-shadow 0.12s ease;
	box-sizing: border-box;
}

.wcigr-auth-btn--google {
	background: #fff;
	color: #1f2937;
	border: 1px solid #e5e7eb;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.wcigr-auth-btn--google:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
	transform: translateY(-1px);
}

.wcigr-auth-btn--wa {
	background: linear-gradient(135deg, #22c55e, #16a34a);
	color: #fff;
	white-space: nowrap;
	padding-left: 0.85rem;
	padding-right: 0.85rem;
	flex: 0 0 auto;
}

.wcigr-auth-btn--wa:hover {
	filter: brightness(1.05);
	transform: translateY(-1px);
}

.wcigr-auth-btn--secondary {
	background: #1e293b;
	color: #fff;
	white-space: nowrap;
	flex: 0 0 auto;
}

.wcigr-auth-btn--secondary:hover {
	background: #0f172a;
}

.wcigr-auth-btn__icon {
	display: flex;
	flex-shrink: 0;
}

.wcigr-auth-label {
	display: block;
	font-size: 0.8rem;
	font-weight: 700;
	color: #334155;
	margin-bottom: 0.4rem;
}

.wcigr-auth-input {
	flex: 1;
	min-width: 0;
	padding: 0.65rem 0.85rem;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	font-size: 0.95rem;
	background: #f8fafc;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.wcigr-auth-input:focus {
	outline: none;
	border-color: #6366f1;
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
	background: #fff;
}

.wcigr-auth-field-row {
	display: flex;
	gap: 0.5rem;
	align-items: stretch;
	margin-bottom: 0.65rem;
}

.wcigr-auth-field-row--otp {
	margin-top: 0.5rem;
}

.wcigr-auth-msg {
	min-height: 1.25rem;
	margin: 0.35rem 0 0;
	font-size: 0.85rem;
	color: #64748b;
}

.wcigr-auth-msg.is-error {
	color: #dc2626;
}

.wcigr-auth-msg.is-success {
	color: #16a34a;
}

@media (max-width: 480px) {
	.wcigr-auth-field-row {
		flex-direction: column;
	}
	.wcigr-auth-btn--wa,
	.wcigr-auth-btn--secondary {
		width: 100%;
	}

	/* Fit modal inside viewport on small phones */
	.wcigr-auth-modal__panel {
		max-height: calc(100vh - 24px);
		overflow: auto;
		padding: 1.25rem 1rem 1rem;
		border-radius: 16px;
	}

	.wcigr-auth-modal__title {
		font-size: 1.25rem;
	}

	.wcigr-auth-modal__close {
		top: 0.55rem;
		right: 0.55rem;
	}
}

/* Floating launcher (sitewide) */
.wcigr-auth-launcher {
	position: fixed;
	right: max(16px, env(safe-area-inset-right));
	bottom: max(20px, env(safe-area-inset-bottom));
	z-index: 99990;
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.65rem 1rem;
	border: none;
	border-radius: 999px;
	cursor: pointer;
	font-weight: 700;
	font-size: 0.9rem;
	color: #fff;
	background: linear-gradient(135deg, #2563eb, #4f46e5);
	box-shadow: 0 10px 32px rgba(37, 99, 235, 0.45);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wcigr-auth-launcher:hover {
	transform: translateY(-2px);
	box-shadow: 0 14px 40px rgba(37, 99, 235, 0.5);
}

.wcigr-auth-launcher__icon {
	display: flex;
	line-height: 0;
}

.wcigr-auth-launcher__text {
	white-space: nowrap;
}

@media (max-width: 380px) {
	.wcigr-auth-launcher__text {
		display: none;
	}
	.wcigr-auth-launcher {
		padding: 0.75rem;
		border-radius: 50%;
	}
}

.wcigr-auth-hint {
	font-size: 0.78rem;
	color: #64748b;
	line-height: 1.4;
	margin: -0.25rem 0 0.5rem;
}

.wcigr-auth-register {
	text-align: center;
	margin: 1rem 0 0;
	padding-top: 0.75rem;
	border-top: 1px solid #e2e8f0;
	font-size: 0.9rem;
	color: #475569;
}

.wcigr-auth-register a {
	font-weight: 600;
	color: #2563eb;
	text-decoration: none;
}

.wcigr-auth-register a:hover {
	text-decoration: underline;
}
