/* SBC Demo Auth — frontend styles
 *
 * The widget has three pieces:
 *   - Fallback login button (floating bottom-right, only shown if no existing login button found)
 *   - Status indicator (floating bottom-right, shown when logged in)
 *   - Login panel (centered modal, shown when triggered)
 */

.sbc-demo-auth-widget {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	font-size: 14px;
	color: #0e1a2b;
}

/* Fallback login button (bottom-right) */
.sbc-demo-auth-fallback-login {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 9998;
	padding: 10px 18px;
	background: #c8102e;
	color: white;
	border: none;
	border-radius: 999px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
	transition: background .2s ease;
}
.sbc-demo-auth-fallback-login:hover {
	background: #a00d24;
}

/* Status indicator — overlays the hijacked login button completely on desktop.
 * On mobile (no visible login button), shows just the Demo Member label below the search icon.
 * JS sets top/left/width/height to match the button's rect (desktop) or search rect (mobile).
 */
.sbc-demo-auth-status {
	position: fixed;
	z-index: 9998;
	display: none;
	pointer-events: none;
}
.sbc-demo-auth-widget[data-state="logged-in"] .sbc-demo-auth-status {
	display: block;
}
.sbc-demo-auth-widget[data-state="logged-in"] .sbc-demo-auth-fallback-login {
	display: none !important;
}

/* Hide the Logout button on mobile (no button to overlay; menu Logout item handles it) */
.sbc-demo-auth-status.is-mobile .sbc-demo-auth-logout-btn {
	display: none;
}
/* On mobile, the Demo Member text is positioned IN the indicator area, not above it */
.sbc-demo-auth-status.is-mobile .sbc-demo-auth-status-username {
	position: static;
	margin: 0;
}

.sbc-demo-auth-status-username {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 100%;
	margin-bottom: 2px;
	text-align: center;
	font-size: 12px;
	font-weight: 700;
	color: #c00000;
	pointer-events: auto;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.sbc-demo-auth-logout-btn {
	width: 100%;
	height: 100%;
	background: white;
	color: #2b6e80;
	border: 1.5px solid #2b6e80;
	border-radius: 999px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
	pointer-events: auto;
	padding: 0;
	transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.sbc-demo-auth-logout-btn:hover {
	background: #c8102e;
	color: white;
	border-color: #c8102e;
}

/* Login panel (centered modal) */
.sbc-demo-auth-panel {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 9999;
	width: 440px;
	max-width: calc(100vw - 48px);
	background: white;
	border-radius: 10px;
	padding: 28px 32px 24px 32px;
	box-shadow: 0 20px 60px rgba(14, 26, 43, 0.18), 0 0 0 1px #e9ecf1;
}
.sbc-demo-auth-panel[hidden] { display: none; }

.sbc-demo-auth-panel::before {
	content: '';
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(255, 255, 255, 0.7);
	backdrop-filter: blur(4px);
	z-index: -1;
}

.sbc-demo-auth-panel h3 {
	margin: 0 0 8px 0;
	font-size: 20px;
	font-weight: 700;
	color: #0e1a2b;
}
.sbc-demo-auth-help {
	margin: 0 0 20px 0;
	font-size: 13px;
	line-height: 1.5;
	color: #475569;
}

.sbc-demo-auth-close {
	position: absolute;
	top: 8px;
	right: 12px;
	background: transparent;
	border: none;
	font-size: 28px;
	line-height: 1;
	color: #94a3b8;
	cursor: pointer;
	padding: 4px 10px;
}
.sbc-demo-auth-close:hover { color: #0e1a2b; }

.sbc-demo-auth-field {
	display: block;
	margin-bottom: 20px;
}
.sbc-demo-auth-field > span {
	display: block;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #475569;
	margin-bottom: 6px;
}
.sbc-demo-auth-field input[type="text"] {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #d9dde3;
	border-radius: 6px;
	font-family: inherit;
	font-size: 14px;
	color: #0e1a2b;
}
.sbc-demo-auth-field input[type="text"]:focus {
	outline: none;
	border-color: #c8102e;
	box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

.sbc-demo-auth-flags {
	border: 1px solid #d9dde3;
	border-radius: 6px;
	padding: 12px 16px;
	margin: 0 0 20px 0;
}
.sbc-demo-auth-flags legend {
	padding: 0 8px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #475569;
}
.sbc-demo-auth-flags label {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 0;
	font-size: 14px;
	color: #0e1a2b;
	cursor: pointer;
}
.sbc-demo-auth-flags label small {
	color: #94a3b8;
	font-size: 12px;
	margin-left: 4px;
}
.sbc-demo-auth-flags input[type="checkbox"] {
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: #c8102e;
}

.sbc-demo-auth-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 8px;
}
.sbc-demo-auth-cancel-btn,
.sbc-demo-auth-login-btn {
	padding: 10px 20px;
	border-radius: 999px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.sbc-demo-auth-cancel-btn {
	background: transparent;
	color: #475569;
	border: 1px solid #d9dde3;
}
.sbc-demo-auth-cancel-btn:hover {
	border-color: #0e1a2b;
	color: #0e1a2b;
}
.sbc-demo-auth-login-btn {
	background: #c8102e;
	color: white;
	border: 1px solid #c8102e;
}
.sbc-demo-auth-login-btn:hover {
	background: #a00d24;
	border-color: #a00d24;
}

/* Responsive */
@media (max-width: 600px) {
	.sbc-demo-auth-status,
	.sbc-demo-auth-fallback-login {
		bottom: 16px;
		right: 16px;
	}
	.sbc-demo-auth-panel {
		padding: 24px 20px 20px 20px;
	}
	.sbc-demo-auth-status-label {
		display: none;
	}
}
