/**
 * GTAW Bridge Login Form Styles
 * Uses unified design tokens and component system
 *
 * @package GTAW_Bridge
 */

/* Hide default login forms on frontend */
.gtaw-login-form-override form:not(.gtaw-custom-login-form form) {
	display: none !important;
}

/* Custom login form container */
.gtaw-custom-login-form {
	width: 100%;
	max-width: var(--gtaw-form-max-width);
	margin: 0 auto;
	padding: var(--gtaw-spacing-3xl) 0;
}

.gtaw-login-container {
	background: var(--gtaw-login-container-bg, var(--gtaw-color-surface));
	border: 1px solid var(--gtaw-login-border-light, var(--gtaw-color-border-light));
	border-radius: var(--gtaw-radius-lg);
	padding: var(--gtaw-spacing-3xl) var(--gtaw-spacing-2xl);
	box-shadow: var(--gtaw-shadow-md);
}

/* Header */
.gtaw-login-header {
	text-align: center;
	margin-bottom: var(--gtaw-spacing-2xl);
}

.gtaw-login-title {
	font-family: var(--gtaw-font-family-heading);
	font-size: var(--gtaw-font-size-2xl);
	font-weight: var(--gtaw-font-weight-semibold);
	color: var(--gtaw-login-text-color, var(--gtaw-color-text));
	margin: 0 0 var(--gtaw-spacing-sm) 0;
	line-height: var(--gtaw-line-height-tight);
}

.gtaw-login-subtitle {
	font-size: var(--gtaw-font-size-base);
	color: var(--gtaw-login-text-secondary, var(--gtaw-color-text-secondary));
	margin: 0;
	line-height: var(--gtaw-line-height-normal);
}

/* ============================================
   Logo
   Standardized BEM naming: .gtaw-login-logo (design system standard)
   ============================================ */

.gtaw-login-logo {
	display: block;
	margin: 0 auto var(--gtaw-spacing-xl);
	max-width: var(--gtaw-login-logo-width, 200px);
	height: auto;
}

/* BEM modifiers for logo alignment */
.gtaw-login-logo--left,
.gtaw-login-logo.logo-left {
	margin-left: 0;
	margin-right: auto;
}

.gtaw-login-logo--right,
.gtaw-login-logo.logo-right {
	margin-right: 0;
	margin-left: auto;
}

/* Content */
.gtaw-login-content {
	margin-bottom: var(--gtaw-spacing-xl);
}

/* OAuth Button - Uses component system with design customization support */
.gtaw-oauth-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--gtaw-spacing-sm);
	padding: 12px 24px;
	border: none;
	border-radius: var(--gtaw-radius-md);
	font-family: var(--gtaw-font-family-base);
	font-size: var(--gtaw-font-size-base);
	font-weight: var(--gtaw-font-weight-medium);
	line-height: var(--gtaw-line-height-normal);
	text-decoration: none;
	cursor: pointer;
	transition: all var(--gtaw-transition-base);
	min-height: var(--gtaw-touch-target-min);
	box-sizing: border-box;
	width: 100%;
	background-color: var(--gtaw-login-primary-color, var(--gtaw-color-primary));
	color: var(--gtaw-color-text-inverse);
	box-shadow: var(--gtaw-shadow-sm);
}

.gtaw-oauth-button:hover {
	background-color: var(--gtaw-login-primary-hover, var(--gtaw-color-primary-hover));
	box-shadow: var(--gtaw-shadow-md);
	transform: translateY(-1px);
	color: var(--gtaw-color-text-inverse);
	text-decoration: none;
}

.gtaw-oauth-button:active {
	transform: translateY(0);
	box-shadow: var(--gtaw-shadow-sm);
}

.gtaw-oauth-button:focus-visible {
	outline: var(--gtaw-focus-width, 2px) solid var(--gtaw-focus-color, var(--gtaw-color-primary));
	outline-offset: var(--gtaw-focus-offset, 2px);
	box-shadow: 0 0 0 4px rgba(47, 103, 246, 0.2);
}

/* ============================================
   OAuth Button Elements
   Standardized BEM naming: .gtaw-oauth-button__* (design system standard)
   Backward compatibility: .gtaw-button-icon, .gtaw-button-text aliases maintained
   ============================================ */

.gtaw-oauth-button__icon,
.gtaw-button-icon {
	display: inline-flex;
	align-items: center;
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}

.gtaw-oauth-button__icon svg,
.gtaw-button-icon svg {
	width: 100%;
	height: 100%;
}

.gtaw-oauth-button__text,
.gtaw-button-text {
	display: inline-block;
}

/* Description */
.gtaw-login-description {
	font-size: var(--gtaw-font-size-sm);
	color: var(--gtaw-login-text-light, var(--gtaw-color-text-light));
	text-align: center;
	margin: var(--gtaw-spacing-lg) 0 0 0;
	line-height: var(--gtaw-line-height-normal);
}

/* Footer */
.gtaw-login-footer {
	text-align: center;
	padding-top: var(--gtaw-spacing-xl);
	border-top: 1px solid var(--gtaw-login-border-light, var(--gtaw-color-border-light));
}

.gtaw-admin-login-link {
	font-size: var(--gtaw-font-size-sm);
	color: var(--gtaw-login-text-secondary, var(--gtaw-color-text-secondary));
	text-decoration: none;
	transition: color var(--gtaw-transition-base);
}

.gtaw-admin-login-link:hover {
	color: var(--gtaw-login-primary-color, var(--gtaw-color-primary));
	text-decoration: underline;
}

.gtaw-admin-login-link:focus-visible {
	outline: var(--gtaw-focus-width, 2px) solid var(--gtaw-focus-color, var(--gtaw-login-primary-color, var(--gtaw-color-primary)));
	outline-offset: var(--gtaw-focus-offset, 2px);
	border-radius: var(--gtaw-radius-sm);
}

/* WooCommerce specific overrides */
.woocommerce .gtaw-custom-login-form,
.woocommerce-page .gtaw-custom-login-form {
	margin: var(--gtaw-spacing-xl) 0;
}

/* Hide password reset links */
.gtaw-login-form-override a[href*="lostpassword"],
.gtaw-login-form-override a[href*="wp-login.php?action=lostpassword"],
.gtaw-login-form-override .woocommerce-form-login a[href*="lostpassword"],
.gtaw-login-form-override .woocommerce-form-login a[href*="password-reset"] {
	display: none !important;
}

/* Full-Page Login Template Styles */
/* Used for standalone full-page login (My Account page redirect) */

.gtaw-login-page-body * {
	box-sizing: border-box;
}

.gtaw-login-page-body html,
.gtaw-login-page-body body {
	height: 100%;
	margin: 0;
	padding: 0;
	overflow: hidden;
	background: var(--gtaw-login-bg-color, #f0f0f1);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* ============================================
   Full-Page Login Wrapper
   Standardized BEM naming: .gtaw-login-page__wrapper (design system standard)
   Backward compatibility: .gtaw-login-page-wrapper alias maintained
   ============================================ */

.gtaw-login-page__wrapper,
.gtaw-login-page-wrapper {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow-y: auto;
	overflow-x: hidden;
	-webkit-overflow-scrolling: touch;
}

.gtaw-login-page {
	max-width: 480px;
	width: calc(100% - 40px);
	margin: 20px auto;
	background: var(--gtaw-login-container-bg, #fff);
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	padding: 48px 40px;
	box-sizing: border-box;
	overflow: visible;
	position: relative;
	z-index: 1;
	flex-shrink: 0;
}

/* Full-page login logo uses CSS variable for dynamic width */
.gtaw-login-page .gtaw-login-logo {
	display: block;
	margin: 0 auto 24px;
	max-width: var(--gtaw-login-logo-width, 200px);
	height: auto;
}

.gtaw-login-page .gtaw-login-logo--left,
.gtaw-login-page .gtaw-login-logo.logo-left {
	margin-left: 0;
}

.gtaw-login-page .gtaw-login-logo--right,
.gtaw-login-page .gtaw-login-logo.logo-right {
	margin-right: 0;
	margin-left: auto;
}

.gtaw-login-page .gtaw-login-header {
	text-align: center;
	margin-bottom: 32px;
}

.gtaw-login-page .gtaw-login-title {
	margin: 0 0 8px;
	font-size: 28px;
	font-weight: 600;
	color: var(--gtaw-login-text-color, #1d2327);
	line-height: 1.2;
}

.gtaw-login-page .gtaw-login-subtitle {
	margin: 0;
	font-size: 15px;
	color: var(--gtaw-login-text-secondary, #646970);
	line-height: 1.5;
}

.gtaw-login-page .gtaw-login-content {
	margin-bottom: 24px;
	width: 100%;
	box-sizing: border-box;
}

.gtaw-login-page .gtaw-oauth-button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 100%;
	padding: 14px 24px;
	background: var(--gtaw-login-primary-color, #2F67F6);
	color: #ffffff;
	text-decoration: none;
	border-radius: 6px;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.5;
	transition: all 0.2s ease;
	border: none;
	cursor: pointer;
	box-shadow: 0 2px 4px rgba(47, 103, 246, 0.2);
	box-sizing: border-box;
}

.gtaw-login-page .gtaw-oauth-button:hover {
	background: var(--gtaw-login-primary-hover, #1e4fd6);
	box-shadow: 0 4px 8px rgba(47, 103, 246, 0.3);
	transform: translateY(-1px);
	color: #ffffff;
	text-decoration: none;
}

.gtaw-login-page .gtaw-oauth-button:active {
	transform: translateY(0);
	box-shadow: 0 2px 4px rgba(47, 103, 246, 0.2);
}

.gtaw-login-page .gtaw-oauth-button:focus {
	outline: 2px solid var(--gtaw-login-primary-color, #2F67F6);
	outline-offset: 2px;
}

.gtaw-login-page .gtaw-oauth-button__icon,
.gtaw-login-page .gtaw-button-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-right: 10px;
	flex-shrink: 0;
}

.gtaw-login-page .gtaw-oauth-button__icon svg,
.gtaw-login-page .gtaw-button-icon svg {
	width: 20px;
	height: 20px;
	display: block;
}

.gtaw-login-page .gtaw-oauth-button__text,
.gtaw-login-page .gtaw-button-text {
	display: inline-block;
	white-space: nowrap;
}

.gtaw-login-page .gtaw-login-description {
	font-size: 13px;
	color: var(--gtaw-login-text-light, #888888);
	text-align: center;
	margin: 16px 0 0 0;
	line-height: 1.5;
}

.gtaw-login-page .gtaw-login-footer {
	text-align: center;
	padding-top: 24px;
	border-top: 1px solid var(--gtaw-login-border-light, #e8e8e8);
}

.gtaw-login-page .gtaw-admin-login-link {
	font-size: 13px;
	color: var(--gtaw-login-text-secondary, #646970);
	text-decoration: none;
	transition: color 0.2s ease;
}

.gtaw-login-page .gtaw-admin-login-link:hover {
	color: var(--gtaw-login-primary-color, #2F67F6);
	text-decoration: underline;
}

.gtaw-login-page .gtaw-admin-login-link:focus {
	outline: 2px solid var(--gtaw-login-primary-color, #2F67F6);
	outline-offset: 2px;
	border-radius: 2px;
}

/* Responsive */
@media (max-width: 480px) {
	.gtaw-custom-login-form {
		padding: var(--gtaw-spacing-xl) var(--gtaw-spacing-lg);
	}

	.gtaw-login-container {
		padding: var(--gtaw-spacing-2xl) var(--gtaw-spacing-xl);
	}

	.gtaw-login-title {
		font-size: var(--gtaw-font-size-xl);
	}

	.gtaw-login-page {
		width: calc(100% - 32px);
		margin: 16px auto;
		padding: 32px 24px;
	}

	.gtaw-login-page .gtaw-login-title {
		font-size: 24px;
	}

	.gtaw-login-page .gtaw-oauth-button {
		padding: 12px 20px;
		font-size: 14px;
	}

	.gtaw-login-page .gtaw-oauth-button__icon,
	.gtaw-login-page .gtaw-button-icon {
		margin-right: 8px;
	}

	.gtaw-login-page .gtaw-oauth-button__icon svg,
	.gtaw-login-page .gtaw-button-icon svg {
		width: 18px;
		height: 18px;
	}
}

@media (max-height: 600px) {
	.gtaw-login-page {
		padding: 32px 24px;
	}

	.gtaw-login-page .gtaw-login-header {
		margin-bottom: 24px;
	}

	.gtaw-login-page .gtaw-login-title {
		font-size: 22px;
	}
}
