/* Stiva Cart Auth Gate & Captcha Modal - Mobile-First Stylesheet */

#stiva-cart-auth-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

#stiva-cart-auth-modal.active-modal {
	opacity: 1;
	pointer-events: auto;
}

.stiva-auth-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(8, 10, 15, 0.88);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

/* Container: Default Mobile View */
.stiva-auth-modal-container {
	position: relative;
	width: 94%;
	max-height: 94vh;
	overflow-y: auto;
	background: #141821;
	border: 2px solid #ac2026;
	border-radius: 10px;
	padding: 20px;
	box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(172, 32, 38, 0.15);
	z-index: 2;
	box-sizing: border-box;
	color: #fff;
	transform: scale(0.9);
	transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
	
	/* Smooth scrollbars for scrollable container */
	scrollbar-width: thin;
	scrollbar-color: #ac2026 #141821;
}

.stiva-auth-modal-container::-webkit-scrollbar {
	width: 6px;
}
.stiva-auth-modal-container::-webkit-scrollbar-track {
	background: #141821;
}
.stiva-auth-modal-container::-webkit-scrollbar-thumb {
	background-color: #ac2026;
	border-radius: 3px;
}

#stiva-cart-auth-modal.active-modal .stiva-auth-modal-container {
	transform: scale(1);
}

/* Close Button: Large touch target for mobile */
.stiva-auth-modal-close {
	position: absolute;
	top: 10px;
	right: 15px;
	background: transparent;
	border: 0;
	color: #94a3b8;
	font-size: 32px;
	cursor: pointer;
	line-height: 1;
	padding: 8px; /* Touch target pad */
	transition: color 0.2s ease;
}

.stiva-auth-modal-close:hover {
	color: #ef4444;
}

/* Header & Logo */
.stiva-auth-modal-logo {
	text-align: center;
	margin-bottom: 20px;
	margin-top: 10px;
}

.stiva-auth-modal-logo h2 {
	font-size: 18px;
	font-weight: 800;
	letter-spacing: 0.1em;
	color: #fff;
	text-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
	margin: 0 0 4px;
	text-transform: uppercase;
}

.stiva-auth-modal-logo p {
	font-size: 10px;
	text-transform: uppercase;
	color: #ef4444;
	letter-spacing: 0.08em;
	margin: 0;
	font-weight: 700;
}

/* Auth Tabs Toggle */
.stiva-auth-tabs {
	display: flex;
	border-bottom: 2px solid rgba(255, 255, 255, 0.08);
	margin-bottom: 20px;
}

.stiva-auth-tab-btn {
	flex: 1;
	background: transparent;
	border: 0;
	padding: 12px;
	color: #94a3b8;
	font-weight: 700;
	cursor: pointer;
	text-transform: uppercase;
	font-size: 12px;
	letter-spacing: 0.05em;
	position: relative;
	transition: color 0.2s ease;
}

.stiva-auth-tab-btn:hover {
	color: #fff;
}

.stiva-auth-tab-btn.active {
	color: #ef4444;
}

.stiva-auth-tab-btn.active::after {
	content: '';
	position: absolute;
	bottom: -2px;
	left: 0;
	right: 0;
	height: 2px;
	background: #ef4444;
	box-shadow: 0 0 8px #ef4444;
}

/* Forms layout */
.stiva-auth-form {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.stiva-form-group {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.stiva-form-group label {
	font-size: 10px;
	font-weight: 800;
	color: #ef4444;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.stiva-form-group input {
	width: 100%;
	background: #1f2633;
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 6px;
	padding: 10px 12px;
	color: #fff;
	font-size: 13px;
	box-sizing: border-box;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.stiva-form-group input:focus {
	border-color: #ef4444;
	outline: none;
	box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
	background: #1a1f29;
}

/* Captcha Layout: Default 1-column on mobile view */
.stiva-captcha-container {
	border: 1px solid rgba(172, 32, 38, 0.35);
	background: rgba(172, 32, 38, 0.04);
	border-radius: 8px;
	padding: 12px;
	box-sizing: border-box;
}

.stiva-captcha-label {
	display: block;
	font-size: 10px;
	font-weight: 800;
	color: #ef4444;
	text-transform: uppercase;
	margin-bottom: 4px;
	letter-spacing: 0.05em;
}

.stiva-captcha-question {
	font-size: 11px;
	line-height: 1.35;
	color: #e2e8f0;
	margin: 0 0 10px 0;
	font-weight: 600;
}

.stiva-captcha-options {
	display: grid;
	grid-template-columns: 1fr;
	gap: 6px;
}

.stiva-captcha-option {
	position: relative;
	cursor: pointer;
}

.stiva-captcha-option input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.stiva-captcha-option .option-box {
	display: block;
	background: #1a202c;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 6px;
	padding: 8px 6px;
	text-align: center;
	font-size: 11px;
	font-weight: 700;
	color: #cbd5e1;
	transition: all 0.2s ease;
	user-select: none;
	box-sizing: border-box;
}

.stiva-captcha-option:hover .option-box {
	background: #232a38;
	border-color: rgba(255,255,255,0.25);
	color: #fff;
}

.stiva-captcha-option input[type="radio"]:checked + .option-box {
	background: rgba(172, 32, 38, 0.25);
	border-color: #ef4444;
	color: #fff;
	box-shadow: 0 0 10px rgba(239, 68, 68, 0.35);
}

/* Submit Buttons */
.stiva-auth-submit-btn {
	background: linear-gradient(135deg, #ac2026 0%, #ef4444 100%);
	color: #fff;
	border: 0;
	border-radius: 6px;
	padding: 12px 20px;
	font-size: 12px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	cursor: pointer;
	transition: transform 0.1s ease, box-shadow 0.2s ease;
	box-shadow: 0 5px 12px rgba(172, 32, 38, 0.3);
	margin-top: 5px;
}

.stiva-auth-submit-btn:hover {
	box-shadow: 0 8px 18px rgba(172, 32, 38, 0.45);
	transform: translateY(-1px);
}

.stiva-auth-submit-btn:active {
	transform: translateY(1px);
}

.stiva-auth-submit-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

/* Message Alert Box */
.stiva-auth-msg-container {
	padding: 10px 12px;
	border-radius: 6px;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.35;
	margin-bottom: 16px;
}

.stiva-auth-msg-container.error-msg {
	background: rgba(239, 68, 68, 0.1);
	border: 1px solid #ef4444;
	color: #fca5a5;
}

.stiva-auth-msg-container.success-msg {
	background: rgba(34, 197, 94, 0.1);
	border: 1px solid #22c55e;
	color: #86efac;
}

/* Prevent scrolling when modal is active */
body.stiva-modal-open {
	overflow: hidden !important;
}

/* ──────────────────────────────────────────────────────────────────────────
   Desktop / Tablet Viewports Override (PC view)
   ────────────────────────────────────────────────────────────────────────── */
@media (min-width: 480px) {
	.stiva-auth-modal-container {
		width: 100%;
		max-width: 440px;
		max-height: 90vh;
		padding: 30px;
		border-radius: 12px;
	}

	.stiva-auth-modal-close {
		top: 15px;
		right: 20px;
		font-size: 28px;
		padding: 0;
	}

	.stiva-auth-modal-logo {
		margin-bottom: 25px;
	}

	.stiva-auth-modal-logo h2 {
		font-size: 20px;
		letter-spacing: 0.12em;
	}

	.stiva-auth-modal-logo p {
		font-size: 11px;
		letter-spacing: 0.10em;
	}

	.stiva-auth-tabs {
		margin-bottom: 25px;
	}

	.stiva-auth-tab-btn {
		font-size: 13px;
	}

	.stiva-auth-form {
		gap: 16px;
	}

	.stiva-form-group {
		gap: 6px;
	}

	.stiva-form-group label {
		font-size: 11px;
	}

	.stiva-form-group input {
		padding: 10px 14px;
	}

	.stiva-captcha-container {
		padding: 15px;
	}

	.stiva-captcha-label {
		font-size: 11px;
		margin-bottom: 6px;
	}

	.stiva-captcha-question {
		font-size: 12px;
		margin-bottom: 12px;
	}

	/* Display options in a 2x2 grid on PC view */
	.stiva-captcha-options {
		grid-template-columns: 1fr 1fr;
		gap: 8px;
	}

	.stiva-captcha-option .option-box {
		padding: 10px 8px;
	}

	.stiva-auth-submit-btn {
		font-size: 13px;
		margin-top: 10px;
	}

	.stiva-auth-msg-container {
		font-size: 12px;
		margin-bottom: 20px;
	}
}
