/**
 * ROUGH Google Login - Frontend Styles
 *
 * Lightweight, responsive CSS adhering to Google Identity Branding Guidelines,
 * compatible with WooCommerce (My Account, Checkout, Connected Accounts) and WoodMart theme.
 */

:root {
	--rough-gl-radius: 6px;
	--rough-gl-font-size: 15px;
	--rough-gl-custom-width: 320px;
}

.rough-gl-wrapper {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	margin: 14px 0;
	box-sizing: border-box;
}

.rough-gl-wrapper--width-auto {
	align-items: flex-start;
}

/* OR Separator */
.rough-gl-separator {
	display: flex;
	align-items: center;
	width: 100%;
	margin: 14px 0;
	color: #767676;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	user-select: none;
}

.rough-gl-separator__line {
	flex: 1;
	height: 1px;
	background-color: rgba(0, 0, 0, 0.12);
}

.rough-gl-separator__text {
	padding: 0 12px;
	line-height: 1;
}

/* Google Sign-In Button */
a.rough-gl-btn,
button.rough-gl-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	min-height: 46px;
	padding: 10px 20px;
	border-radius: var(--rough-gl-radius, 6px);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	font-size: var(--rough-gl-font-size, 15px);
	font-weight: 500;
	line-height: 1.25;
	text-decoration: none !important;
	cursor: pointer;
	box-sizing: border-box;
	transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.1s ease;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

/* Theme Variant: Light (Default Google Standard White) */
a.rough-gl-btn--style-light,
button.rough-gl-btn--style-light {
	background-color: #ffffff;
	color: #1f1f1f !important;
	border: 1px solid #dadce0;
	box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
}

a.rough-gl-btn--style-light:hover,
button.rough-gl-btn--style-light:hover {
	background-color: #f8faff;
	border-color: #d2e3fc;
	color: #1f1f1f !important;
	box-shadow: 0 1px 3px rgba(60, 64, 67, 0.16);
}

a.rough-gl-btn--style-light:active,
button.rough-gl-btn--style-light:active {
	background-color: #ecf3fe;
	transform: translateY(0.5px);
}

/* Theme Variant: Neutral */
a.rough-gl-btn--style-neutral,
button.rough-gl-btn--style-neutral {
	background-color: #f2f2f2;
	color: #1f1f1f !important;
	border: 1px solid #e0e0e0;
}

a.rough-gl-btn--style-neutral:hover,
button.rough-gl-btn--style-neutral:hover {
	background-color: #e8eaed;
	border-color: #d2d5d9;
	color: #1f1f1f !important;
}

/* Theme Variant: Dark */
a.rough-gl-btn--style-dark,
button.rough-gl-btn--style-dark {
	background-color: #131314;
	color: #e3e3e3 !important;
	border: 1px solid #8e918f;
}

a.rough-gl-btn--style-dark:hover,
button.rough-gl-btn--style-dark:hover {
	background-color: #1f1f22;
	border-color: #a8c7fa;
	color: #ffffff !important;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

/* Accessible Focus State */
a.rough-gl-btn:focus-visible,
button.rough-gl-btn:focus-visible {
	outline: 2px solid #4285f4;
	outline-offset: 2px;
	box-shadow: 0 0 0 4px rgba(66, 133, 244, 0.2);
}

/* Button Width Options */
.rough-gl-btn--width-full {
	width: 100%;
}

.rough-gl-btn--width-auto {
	width: auto;
}

.rough-gl-btn--width-custom {
	width: 100%;
	max-width: var(--rough-gl-custom-width, 320px);
}

/* Icon & Label */
.rough-gl-btn__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	background-color: #ffffff;
	border-radius: 3px;
}

.rough-gl-btn--style-dark .rough-gl-btn__icon {
	padding: 2px;
	width: 22px;
	height: 22px;
}

.rough-gl-svg {
	display: block;
	width: 18px;
	height: 18px;
}

.rough-gl-btn__label {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-weight: 500;
	letter-spacing: 0.01em;
}

/* Loading Spinner State */
.rough-gl-btn__spinner {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(66, 133, 244, 0.25);
	border-top-color: #4285f4;
	border-radius: 50%;
	animation: roughGlSpin 0.65s linear infinite;
}

.rough-gl-btn.is-loading {
	pointer-events: none;
	opacity: 0.85;
}

.rough-gl-btn.is-loading .rough-gl-btn__spinner {
	display: inline-block;
}

@keyframes roughGlSpin {
	to {
		transform: rotate(360deg);
	}
}

/* Express Checkout Banner Box */
.rough-gl-checkout-box {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 20px;
	margin-bottom: 24px;
	background-color: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
}

.rough-gl-checkout-box__text {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1 1 260px;
}

.rough-gl-checkout-box__text strong {
	font-size: 15px;
	color: #111827;
}

.rough-gl-checkout-box__text span {
	font-size: 13px;
	color: #4b5563;
	line-height: 1.4;
}

.rough-gl-checkout-box__action .rough-gl-wrapper {
	margin: 0;
	width: auto;
}

/* Connected Accounts Section (WooCommerce My Account) */
.rough-gl-connected-accounts {
	margin-top: 28px;
	padding-top: 20px;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.rough-gl-connected-accounts__title {
	margin: 0 0 6px;
	font-size: 18px;
	font-weight: 600;
}

.rough-gl-connected-accounts__desc {
	margin: 0 0 18px;
	color: #555;
	font-size: 14px;
}

.rough-gl-provider-card {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 20px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.rough-gl-provider-card__info {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	flex: 1 1 280px;
}

.rough-gl-provider-card__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	flex-shrink: 0;
}

.rough-gl-provider-card__header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 4px;
}

.rough-gl-provider-card__name {
	font-size: 15px;
	color: #0f172a;
}

.rough-gl-badge {
	display: inline-block;
	padding: 2px 8px;
	font-size: 11px;
	font-weight: 600;
	border-radius: 999px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.rough-gl-badge--success {
	background-color: #dcfce7;
	color: #166534;
}

.rough-gl-badge--neutral {
	background-color: #f1f5f9;
	color: #475569;
}

.rough-gl-provider-card__meta {
	margin: 0;
	font-size: 13px;
	color: #475569;
}

.rough-gl-provider-card__warning {
	margin: 8px 0 0;
	font-size: 12.5px;
	color: #9a3412;
	background: #fff7ed;
	padding: 6px 10px;
	border-radius: 5px;
	border: 1px solid #fed7aa;
}

.rough-gl-btn-disconnect {
	background-color: #fff1f2 !important;
	color: #be123c !important;
	border: 1px solid #fecdd3 !important;
	border-radius: 6px !important;
	padding: 8px 16px !important;
	font-size: 13px !important;
	font-weight: 500 !important;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.rough-gl-btn-disconnect:hover {
	background-color: #ffe4e6 !important;
}

/* Inline Alert Notice */
.rough-gl-alert {
	width: 100%;
	padding: 10px 14px;
	margin-bottom: 12px;
	border-radius: 6px;
	font-size: 13.5px;
	line-height: 1.4;
	box-sizing: border-box;
}

.rough-gl-alert--error {
	background-color: #fef2f2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

.rough-gl-alert--notice,
.rough-gl-alert--success {
	background-color: #f0fdf4;
	color: #166534;
	border: 1px solid #bbf7d0;
}

/* WoodMart Off-Canvas Login Sidebar & Popup Compatibility */
.login-form-side .rough-gl-wrapper,
.wd-login-form .rough-gl-wrapper {
	margin: 12px 0 6px;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
	.rough-gl-checkout-box {
		flex-direction: column;
		align-items: stretch;
	}

	.rough-gl-checkout-box__action,
	.rough-gl-checkout-box__action .rough-gl-wrapper,
	.rough-gl-checkout-box__action .rough-gl-btn {
		width: 100%;
	}

	.rough-gl-provider-card {
		flex-direction: column;
		align-items: stretch;
	}

	.rough-gl-provider-card__actions,
	.rough-gl-provider-card__actions .rough-gl-btn,
	.rough-gl-provider-card__actions .rough-gl-btn-disconnect {
		width: 100%;
		justify-content: center;
		text-align: center;
	}
}
