/* ──────────────────────────────────────────────────────
   Google Sign-In — custom button visually (matches /login),
   Google's rendered iframe layered on top invisibly so
   clicks still flow through to the real Sign-In flow.
   ────────────────────────────────────────────────────── */

/* Google's One Tap container is fixed at the top-right of the viewport
   and overlaps our sticky navbar — nudge it below. */
#credential_picker_container,
#credential_picker_iframe {
	top: calc(var(--gx-navbar-height, 56px) + 8px) !important;
}

/* Mirrors .gxu-auth__social-btn from gxu-auth.css, which is only
   enqueued on the standalone /login template. Duplicated here so the
   modal button keeps its look on any page the modal opens on. */
.gxu-auth-modal__body .gxu-auth__social {
	display: flex;
	flex-direction: column;
	gap: var(--gx-sp-3);
	margin-top: var(--gx-sp-4);
}

.gxu-google-wrap {
	position: relative;
}

.gxu-google-wrap .gxu-auth__social-btn--google {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--gx-sp-2);
	padding: var(--gx-sp-3) var(--gx-sp-4);
	border: 1px solid var(--gx-border);
	border-radius: var(--gx-radius-md);
	background: var(--gx-bg-tertiary);
	color: var(--gx-text-primary);
	font-size: var(--gx-text-sm);
	font-weight: 600;
	transition: background var(--gx-transition), border-color var(--gx-transition);
}

.gxu-google-wrap .gxu-auth__social-btn--google .gxu-google-logo {
	flex-shrink: 0;
}

/* Hover effect applies to the wrapper (the real iframe is on top
   and captures pointer events, so button :hover never fires). */
.gxu-google-wrap:hover .gxu-auth__social-btn--google {
	background: var(--gx-bg-card-hover);
	border-color: var(--gx-border-light);
}

/* Divider — mirror .gxu-auth__divider from gxu-auth.css for the same reason. */
.gxu-auth-modal__body .gxu-auth__divider {
	display: flex;
	align-items: center;
	gap: var(--gx-sp-3);
	margin: var(--gx-sp-4) 0;
	color: var(--gx-text-muted);
	font-size: var(--gx-text-xs);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}
.gxu-auth-modal__body .gxu-auth__divider::before,
.gxu-auth-modal__body .gxu-auth__divider::after {
	content: '';
	flex: 1;
	height: 1px;
	background: var(--gx-border);
}

/* The real Google iframe — stretched over the custom button, invisible.
   Scoped to known positioned parents so a stray .gxu-google-btn-slot can
   never become a full-viewport overlay if its wrapper CSS fails to load. */
.gxu-google-wrap .gxu-google-btn-slot,
.gxu-google-mobile-bar__cta-wrap .gxu-google-btn-slot {
	position: absolute;
	inset: 0;
	opacity: 0;
	z-index: 2;
	overflow: hidden;
	cursor: pointer;
}
.gxu-google-wrap .gxu-google-btn-slot > div,
.gxu-google-wrap .gxu-google-btn-slot iframe,
.gxu-google-mobile-bar__cta-wrap .gxu-google-btn-slot > div,
.gxu-google-mobile-bar__cta-wrap .gxu-google-btn-slot iframe {
	width: 100% !important;
	height: 100% !important;
	min-width: 100% !important;
}

/* ── Username step (new-signup flow) ───────────────── */

.gxu-gsi-username {
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.gxu-gsi-username__title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 700;
}
.gxu-gsi-username__lead {
	margin: 0 0 8px;
	color: var(--gx-text-secondary);
	font-size: 0.9rem;
	line-height: 1.5;
}
.gxu-gsi-username__email {
	font-weight: 600;
	color: var(--gx-text-primary);
}
.gxu-gsi-username__msg {
	padding: 10px 12px;
	border-radius: 6px;
	font-size: 0.9rem;
}
.gxu-gsi-username__msg.gxu-msg--error {
	background: rgba(225, 112, 85, 0.12);
	color: #e17055;
}
.gxu-gsi-username__msg.gxu-msg--success {
	background: rgba(0, 184, 148, 0.12);
	color: #00b894;
}
.gxu-gsi-username__form {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* ── Mobile bottom sheet — custom One Tap (matches prothomalo's layout) ── */

.gxu-google-mobile-bar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9999;
	padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
	color: var(--gx-text-primary);
	background: rgba(17, 19, 23, 0.75);
	border-top: 1px solid rgba(46, 49, 56, 0.4);
	border-radius: 20px 20px 0 0;
	box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.35);
	backdrop-filter: saturate(180%) blur(20px);
	-webkit-backdrop-filter: saturate(180%) blur(20px);
	animation: gxu-google-bar-in 220ms ease-out;
	overflow: hidden;
}

[data-theme="light"] .gxu-google-mobile-bar {
	background: rgba(255, 255, 255, 0.75);
	border-top-color: rgba(0, 0, 0, 0.08);
}

@keyframes gxu-google-bar-in {
	from { transform: translateY(100%); }
	to   { transform: translateY(0); }
}

.gxu-google-mobile-bar__progress {
	position: absolute;
	left: 0;
	bottom: 0;
	height: 2px;
	width: 100%;
	background: var(--gx-accent);
	pointer-events: none;
}

.gxu-google-mobile-bar__head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
}

.gxu-google-mobile-bar__g {
	flex-shrink: 0;
	background: #fff;
	border-radius: 50%;
	padding: 3px;
	box-sizing: content-box;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.gxu-google-mobile-bar__title {
	flex: 1;
	font-size: 0.9rem;
	line-height: 1.35;
	color: var(--gx-text-primary);
}

.gxu-google-mobile-bar__close {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	color: var(--gx-text-muted);
	cursor: pointer;
	border-radius: 50%;
	margin: -4px -6px -4px 0;
}
.gxu-google-mobile-bar__close:hover {
	background: var(--gx-bg-card-hover);
	color: var(--gx-text-primary);
}

/* CTA wrapper: custom button visually, Google's rendered iframe overlaid
   invisibly on top so the click drives the real Sign-In flow. */
.gxu-google-mobile-bar__cta-wrap {
	position: relative;
}

.gxu-google-mobile-bar__cta {
	width: 100%;
	padding: 12px 16px;
	background: var(--gx-accent);
	color: #fff;
	border: none;
	border-radius: 8px;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
	line-height: 1.3;
}
.gxu-google-mobile-bar__cta:active {
	background: hsl(211, 100%, 40%);
}

.gxu-google-mobile-bar__cta-wrap .gxu-google-btn-slot {
	position: absolute;
	inset: 0;
	opacity: 0;
	z-index: 2;
	overflow: hidden;
	cursor: pointer;
}
.gxu-google-mobile-bar__cta-wrap .gxu-google-btn-slot > div,
.gxu-google-mobile-bar__cta-wrap .gxu-google-btn-slot iframe {
	width: 100% !important;
	height: 100% !important;
	min-width: 100% !important;
}

@media (min-width: 768px) {
	.gxu-google-mobile-bar { display: none !important; }
}
