/**
 * Auth Page — full-viewport side-by-side login / register.
 *
 * Depends on design-tokens.css for CSS custom properties.
 *
 * @package TenderPipe
 * @since   2.1.0
 */

/* ======================================================
   Reset & base
   ====================================================== */

body.tp-auth-page {
	margin: 0;
	padding: 0;
	min-height: 100vh;
	font-family: var(--tp-font-family, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
	color: var(--tp-gray-800, #1F2937);
	background: #fff;
	-webkit-font-smoothing: antialiased;
}

body.tp-auth-page *,
body.tp-auth-page *::before,
body.tp-auth-page *::after {
	box-sizing: border-box;
}

/* Hide Astra / WP chrome that might leak through — but keep our unified header */
body.tp-auth-page #page,
body.tp-auth-page .ast-container,
body.tp-auth-page .site-header,
body.tp-auth-page .site-footer,
body.tp-auth-page #ast-desktop-header,
body.tp-auth-page .ast-above-header-wrap,
body.tp-auth-page .ast-below-header-wrap,
body.tp-auth-page .ast-mobile-header-wrap,
body.tp-auth-page #masthead,
body.tp-auth-page .wp-site-blocks > header,
body.tp-auth-page .wp-site-blocks > footer,
body.tp-auth-page #wpadminbar {
	display: none !important;
}

/* Keep the TenderPipe unified header visible */
body.tp-auth-page .tp-header-unified {
	display: block !important;
}

/* Kill any top margin/padding from Astra or admin bar (but keep header space) */
html.tp-auth-page-html,
body.tp-auth-page,
body.tp-auth-page.admin-bar {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

/* Header sits at the top, no extra spacing needed */
body.tp-auth-page .tp-header-unified {
	position: sticky;
	top: 0;
	z-index: 1000;
}

/* Remove admin bar spacing */
html.tp-auth-page-html {
	overflow-x: hidden;
}

@media screen and (max-width: 782px) {
	html.tp-auth-page-html {
		margin-top: 0 !important;
	}
}

/* ======================================================
   Layout
   ====================================================== */

.tp-auth-layout {
	display: grid;
	grid-template-columns: 1fr 1fr;
	min-height: calc(100vh - var(--tp-header-height, 80px));
}

/* ======================================================
   Left Panel — Brand
   ====================================================== */

.tp-auth-brand {
	background: linear-gradient(
		155deg,
		var(--tp-primary, #0066CC) 0%,
		#003D7A 50%,
		var(--tp-primary-900, #001429) 100%
	);
	color: #fff !important;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 3rem 3.5rem;
	position: sticky;
	top: var(--tp-header-height, 80px);
	height: calc(100vh - var(--tp-header-height, 80px));
	overflow-y: auto;
}

/* Force white text throughout brand panel — overrides Astra globals */
.tp-auth-brand h1,
.tp-auth-brand p,
.tp-auth-brand li,
.tp-auth-brand span,
.tp-auth-brand a {
	color: #fff !important;
}

.tp-auth-brand__wordmark-pipe {
	color: var(--tp-accent, #FF6B35) !important;
}

.tp-auth-brand__inner {
	max-width: 480px;
	width: 100%;
}

/* Logo */
.tp-auth-brand__logo {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	margin-bottom: 2.5rem;
}

.tp-auth-brand__logo img {
	display: none;
	/* Logo PNG doesn't work on dark gradient — wordmark only */
}

.tp-auth-brand__wordmark {
	font-size: 1.6rem;
	font-weight: 650;
	line-height: 1;
}

.tp-auth-brand__wordmark-tender {
	color: #fff;
}

.tp-auth-brand__wordmark-pipe {
	color: var(--tp-accent, #FF6B35);
}

/* Headline */
.tp-auth-brand__headline {
	font-size: clamp(1.75rem, 3vw, 2.5rem);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.02em;
	margin: 0 0 1rem;
}

.tp-auth-brand__subtitle {
	font-size: 1.05rem;
	line-height: 1.6;
	opacity: 0.85;
	margin: 0 0 2.25rem;
}

/* Feature bullets */
.tp-auth-brand__features {
	list-style: none;
	padding: 0;
	margin: 0 0 2.5rem;
	display: flex;
	flex-direction: column;
	gap: 0.875rem;
}

.tp-auth-brand__features li {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	font-size: 0.95rem;
	line-height: 1.5;
}

.tp-auth-check {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	margin-top: 2px;
}

/* Social proof */
.tp-auth-brand__proof {
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: var(--tp-radius-lg, 10px);
	padding: 1rem 1.25rem;
	margin-bottom: 1.5rem;
}

.tp-auth-brand__proof p {
	margin: 0;
	font-size: 0.9rem;
	font-weight: 500;
	line-height: 1.5;
}

/* Trust line */
.tp-auth-brand__trust {
	font-size: 0.8rem;
	opacity: 0.7;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 0.5rem;
}

.tp-auth-brand__trust-dot {
	opacity: 0.5;
}

/* ======================================================
   Right Panel — Forms
   ====================================================== */

.tp-auth-form-panel {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2.5rem;
	overflow-y: auto;
	min-height: calc(100vh - var(--tp-header-height, 80px));
	background: var(--tp-gray-50, #F9FAFB);
}

.tp-auth-form-panel__inner {
	width: 100%;
	max-width: 420px;
}

/* Mobile logo — hidden on desktop */
.tp-auth-mobile-logo {
	display: none;
}

/* ======================================================
   Tabs
   ====================================================== */

.tp-auth-tabs {
	display: flex;
	border-bottom: 2px solid var(--tp-gray-200, #E5E7EB);
	margin-bottom: 2rem;
}

.tp-auth-tab {
	flex: 1;
	padding: 0.75rem 0.5rem !important;
	background: none !important;
	background-color: transparent !important;
	border: none !important;
	border-bottom: 2px solid transparent !important;
	border-radius: 0 !important;
	margin-bottom: -2px;
	font-family: inherit;
	font-size: 0.95rem !important;
	font-weight: 500;
	color: var(--tp-gray-500, #6B7280) !important;
	cursor: pointer;
	transition: color 0.15s ease, border-color 0.15s ease;
	text-align: center;
	box-shadow: none !important;
	text-decoration: none !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	line-height: 1.5 !important;
}

.tp-auth-tab:hover,
.tp-auth-tab:focus {
	color: var(--tp-gray-700, #374151) !important;
	background: none !important;
	background-color: transparent !important;
	border: none !important;
	border-bottom: 2px solid var(--tp-gray-300, #D1D5DB) !important;
	box-shadow: none !important;
}

.tp-auth-tab.is-active,
.tp-auth-tab.is-active:hover,
.tp-auth-tab.is-active:focus {
	color: var(--tp-primary, #0066CC) !important;
	background: none !important;
	background-color: transparent !important;
	border: none !important;
	border-bottom: 2px solid var(--tp-primary, #0066CC) !important;
	font-weight: 600;
	box-shadow: none !important;
}

/* ======================================================
   Panels
   ====================================================== */

.tp-auth-panel {
	display: none;
}

.tp-auth-panel.is-active {
	display: block;
	animation: tp-auth-fadein 0.2s ease;
}

@keyframes tp-auth-fadein {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Reset steps */
.tp-reset-step.is-hidden {
	display: none;
}

/* ======================================================
   Form fields
   ====================================================== */

.tp-auth-form {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.tp-auth-field label {
	display: block;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--tp-gray-700, #374151);
	margin-bottom: 0.375rem;
}

.tp-auth-field input[type="email"],
.tp-auth-field input[type="password"],
.tp-auth-field input[type="text"] {
	width: 100% !important;
	padding: 0.7rem 0.875rem !important;
	font-family: inherit;
	font-size: 0.95rem !important;
	color: var(--tp-gray-800, #1F2937) !important;
	background: #fff !important;
	background-color: #fff !important;
	border: 1px solid var(--tp-gray-200, #E5E7EB) !important;
	border-radius: var(--tp-radius-base, 8px) !important;
	outline: none !important;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	box-shadow: none !important;
}

.tp-auth-field input[type="email"]:focus,
.tp-auth-field input[type="password"]:focus,
.tp-auth-field input[type="text"]:focus {
	border-color: var(--tp-primary, #0066CC) !important;
	box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.12) !important;
	background: #fff !important;
	background-color: #fff !important;
	color: var(--tp-gray-800, #1F2937) !important;
}

.tp-auth-field input::placeholder {
	color: var(--tp-gray-400, #9CA3AF);
}

/* Label + forgot row */
.tp-auth-field__row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
}

.tp-auth-forgot-link {
	font-size: 0.8rem;
	font-weight: 500;
	color: var(--tp-primary, #0066CC);
	text-decoration: none;
}

.tp-auth-forgot-link:hover {
	text-decoration: underline;
}

/* Password visibility toggle */
.tp-auth-field__password-wrap {
	position: relative;
}

.tp-auth-field__password-wrap input {
	padding-right: 2.75rem;
}

.tp-auth-password-toggle {
	position: absolute;
	right: 0.625rem;
	top: 50%;
	transform: translateY(-50%);
	background: none !important;
	background-color: transparent !important;
	border: none !important;
	padding: 0.25rem !important;
	cursor: pointer;
	color: var(--tp-gray-400, #9CA3AF) !important;
	display: flex;
	align-items: center;
	transition: color 0.15s;
	box-shadow: none !important;
}

.tp-auth-password-toggle:hover,
.tp-auth-password-toggle:focus {
	color: var(--tp-gray-600, #4B5563) !important;
	background: none !important;
	background-color: transparent !important;
	box-shadow: none !important;
}

/* Checkbox */
.tp-auth-field__checkbox {
	display: flex;
	align-items: center;
}

.tp-auth-field__checkbox label {
	font-size: 0.85rem;
	font-weight: 400;
	color: var(--tp-gray-600, #4B5563);
	display: flex;
	align-items: center;
	gap: 0.5rem;
	cursor: pointer;
	margin-bottom: 0;
}

.tp-auth-field__checkbox input[type="checkbox"] {
	width: 16px;
	height: 16px;
	accent-color: var(--tp-primary, #0066CC);
}

/* Hint text */
.tp-auth-hint {
	display: block;
	font-size: 0.775rem;
	color: var(--tp-gray-500, #6B7280);
	margin-top: 0.25rem;
}

/* Description text */
.tp-auth-description {
	font-size: 0.9rem;
	color: var(--tp-gray-600, #4B5563);
	line-height: 1.6;
	margin: 0 0 0.5rem;
}

/* ======================================================
   Submit button
   ====================================================== */

.tp-auth-submit {
	width: 100% !important;
	padding: 0.8rem 1.5rem !important;
	font-family: inherit;
	font-size: 1rem !important;
	font-weight: 600;
	color: #fff !important;
	background: var(--tp-accent, #FF6B35) !important;
	background-color: var(--tp-accent, #FF6B35) !important;
	border: none !important;
	border-radius: var(--tp-radius-base, 8px) !important;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
	text-align: center;
	line-height: 1.4 !important;
	text-transform: none !important;
	letter-spacing: normal !important;
}

.tp-auth-submit:hover,
.tp-auth-submit:focus {
	background: var(--tp-accent-dark, #E55A2B) !important;
	background-color: var(--tp-accent-dark, #E55A2B) !important;
	color: #fff !important;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(255, 107, 53, 0.25) !important;
}

.tp-auth-submit:active {
	transform: translateY(0);
}

.tp-auth-submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none !important;
	box-shadow: none !important;
}

/* Submitting state */
.tp-auth-form.is-submitting .tp-auth-submit::after {
	content: '';
	display: inline-block;
	width: 16px;
	height: 16px;
	margin-left: 0.5rem;
	border: 2px solid rgba(255,255,255,0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: tp-auth-spin 0.6s linear infinite;
	vertical-align: middle;
}

@keyframes tp-auth-spin {
	to { transform: rotate(360deg); }
}

/* ======================================================
   Switch + text buttons
   ====================================================== */

.tp-auth-switch {
	text-align: center;
	font-size: 0.875rem;
	color: var(--tp-gray-500, #6B7280);
	margin: 0.5rem 0 0;
}

.tp-auth-switch a {
	color: var(--tp-primary, #0066CC);
	text-decoration: none;
}

.tp-auth-switch a:hover {
	text-decoration: underline;
}

.tp-auth-page .tp-btn-text {
	background: none !important;
	background-color: transparent !important;
	border: none !important;
	color: var(--tp-primary, #0066CC) !important;
	font-family: inherit;
	font-size: 0.875rem !important;
	font-weight: 500;
	cursor: pointer;
	padding: 0.5rem 0 !important;
	text-align: center;
	box-shadow: none !important;
	text-transform: none !important;
}

.tp-auth-page .tp-btn-text:hover,
.tp-auth-page .tp-btn-text:focus {
	text-decoration: underline;
	background: none !important;
	background-color: transparent !important;
	color: var(--tp-primary, #0066CC) !important;
	box-shadow: none !important;
}

/* ======================================================
   Message area
   ====================================================== */

.tp-auth-message:empty {
	display: none;
}

.tp-auth-message {
	padding: 0.75rem 1rem;
	border-radius: var(--tp-radius-base, 8px);
	font-size: 0.875rem;
	line-height: 1.5;
	margin-top: 1rem;
	text-align: center;
}

.tp-auth-message.is-error {
	background: var(--tp-error-bg, #FEE2E2);
	color: var(--tp-error, #EF4444);
}

.tp-auth-message.is-success {
	background: var(--tp-success-bg, #D1FAE5);
	color: var(--tp-success, #10B981);
}

/* ======================================================
   Footer nav
   ====================================================== */

.tp-auth-footer-nav {
	text-align: center;
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--tp-gray-200, #E5E7EB);
}

.tp-auth-footer-nav a {
	font-size: 0.85rem;
	color: var(--tp-gray-500, #6B7280);
	text-decoration: none;
	transition: color 0.15s;
}

.tp-auth-footer-nav a:hover {
	color: var(--tp-primary, #0066CC);
}

/* ======================================================
   Mobile responsive
   ====================================================== */

@media (max-width: 991px) {
	.tp-auth-brand {
		padding: 2.5rem 2rem;
	}

	.tp-auth-brand__headline {
		font-size: 1.75rem;
	}
}

@media (max-width: 767px) {
	.tp-auth-layout {
		grid-template-columns: 1fr;
		grid-template-rows: auto 1fr;
	}

	/* Hide the full brand panel on mobile */
	.tp-auth-brand {
		display: none;
	}

	/* Show mobile logo */
	.tp-auth-mobile-logo {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		text-decoration: none;
		margin-bottom: 1.75rem;
	}

	.tp-auth-mobile-logo img {
		height: 36px;
		width: auto;
	}

	.tp-auth-mobile-logo .tp-auth-brand__wordmark {
		font-size: 1.35rem;
	}

	.tp-auth-mobile-logo .tp-auth-brand__wordmark-tender {
		color: var(--tp-primary, #0066CC);
	}

	.tp-auth-mobile-logo .tp-auth-brand__wordmark-pipe {
		color: var(--tp-accent, #FF6B35);
	}

	.tp-auth-form-panel {
		padding: 2rem 1.25rem;
		min-height: auto;
		align-items: flex-start;
		padding-top: 2.5rem;
	}

	.tp-auth-form-panel__inner {
		max-width: 100%;
	}
}

@media (max-width: 480px) {
	.tp-auth-form-panel {
		padding: 1.5rem 1rem;
		padding-top: 2rem;
	}

	.tp-auth-tab {
		font-size: 0.875rem;
	}
}
