/* Shared theme for auth pages (login/register/forgot-password/reset-password).
   Color tokens copied from assets/platforms/affiliate/assets/style.css so
   these pages match the Affiliate Platform landing dark theme. */
:root {
	--bg: #f4f7fb;
	--bg-elevated: rgba(255, 255, 255, 0.72);
	--text: #10131a;
	--text-muted: #5b6472;
	--border: rgba(15, 23, 42, 0.08);
	--accent: #ee3244;
	--accent-rgb: 238, 50, 68;
	--accent-2: #310085;
	--accent-2-rgb: 49, 0, 133;
	--card-shadow: 0 20px 60px -20px rgba(30, 41, 59, 0.25);
}

[data-theme='dark'] {
	--bg: #06070d;
	--bg-elevated: rgba(20, 22, 34, 0.72);
	--text: #f2f4f9;
	--text-muted: #9aa3b5;
	--border: rgba(255, 255, 255, 0.08);
	--accent: #f2536a;
	--accent-rgb: 242, 83, 106;
	--accent-2: #5b2bb8;
	--accent-2-rgb: 91, 43, 184;
	--card-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
}

* {
	box-sizing: border-box;
}

.hidden {
	display: none !important;
}

html, body {
	height: 100%;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
	transition: background 0.4s ease, color 0.4s ease;
}

#neuron-bg {
	position: fixed;
	inset: 0;
	z-index: 0;
}

.auth-page {
	position: relative;
	z-index: 1;
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px 16px;
}

.auth-wrap {
	width: 100%;
	max-width: 496px;
}

.auth-brand {
	display: flex;
	justify-content: center;
	margin-bottom: 8px;
}

.auth-brand img {
	height: 64px;
	width: auto;
}

.auth-card {
	background: var(--bg-elevated);
	border: 1px solid var(--border);
	border-radius: 18px;
	box-shadow: var(--card-shadow);
	padding: 32px;
	backdrop-filter: blur(14px);
}

.auth-title {
	margin: 0 0 24px;
	text-align: center;
	font-size: 1.4rem;
	font-weight: 800;
	letter-spacing: -0.02em;
}

.auth-field {
	margin-bottom: 16px;
}

.auth-label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--text-muted);
}

.auth-label .required {
	color: var(--accent);
}

.auth-input-group {
	position: relative;
	display: flex;
	align-items: stretch;
}

.auth-input {
	width: 100%;
	padding: 11px 14px;
	border-radius: 10px;
	border: 1px solid var(--border);
	background: rgba(var(--accent-2-rgb), 0.04);
	color: var(--text);
	font-size: 0.95rem;
	font-family: inherit;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18);
}

.auth-input-group .auth-input {
	padding-right: 44px;
}

.auth-toggle-password {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	color: var(--text-muted);
	cursor: pointer;
	padding: 4px;
	line-height: 0;
}

.auth-toggle-password:hover {
	color: var(--text);
}

.auth-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 12px 20px;
	border-radius: 10px;
	border: none;
	font-size: 0.98rem;
	font-weight: 700;
	cursor: pointer;
	color: #fff;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	box-shadow: 0 12px 30px -12px rgba(var(--accent-rgb), 0.55);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.auth-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 16px 34px -12px rgba(var(--accent-rgb), 0.65);
}

.auth-btn:disabled {
	opacity: 0.65;
	cursor: not-allowed;
	transform: none;
}

.auth-btn-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	margin-right: 8px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: auth-spin 0.7s linear infinite;
	flex-shrink: 0;
}

.auth-btn-ghost .auth-btn-spinner {
	border-color: rgba(var(--accent-rgb), 0.3);
	border-top-color: var(--accent);
}

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

/* Dim the Google Identity Services button while a request it triggered is
   in flight — the button itself is rendered by Google's script and can't
   be restyled directly, so this wraps its container instead. */
.auth-google-btn.auth-google-btn-loading {
	opacity: 0.5;
	pointer-events: none;
}

.auth-btn-ghost {
	background: transparent;
	color: var(--text);
	border: 1px solid var(--border);
	box-shadow: none;
}

.auth-link-btn {
	display: inline-block;
	margin-top: 6px;
	padding: 0;
	background: none;
	border: none;
	color: var(--accent);
	font-size: 0.85rem;
	font-weight: 600;
	cursor: pointer;
}

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

.auth-input[readonly] {
	background: rgba(var(--accent-2-rgb), 0.09);
	color: var(--text-muted);
	cursor: not-allowed;
}

.auth-alert {
	padding: 12px 14px;
	border-radius: 10px;
	font-size: 0.88rem;
	margin-bottom: 16px;
	border: 1px solid transparent;
}

.auth-alert-danger {
	background: rgba(var(--accent-rgb), 0.12);
	border-color: rgba(var(--accent-rgb), 0.35);
	color: var(--accent);
}

.auth-alert-success {
	background: rgba(34, 197, 94, 0.12);
	border-color: rgba(34, 197, 94, 0.35);
	color: #22c55e;
}

.auth-field-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.auth-toast-container {
	position: fixed;
	top: 20px;
	right: 20px;
	z-index: 1000;
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-width: 360px;
	width: calc(100% - 40px);
}

.auth-toast {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px 14px;
	border-radius: 10px;
	font-size: 0.88rem;
	line-height: 1.4;
	border: 1px solid transparent;
	background: var(--bg-elevated);
	box-shadow: var(--card-shadow);
	backdrop-filter: blur(8px);
	opacity: 0;
	transform: translateX(16px);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.auth-toast.auth-toast-visible {
	opacity: 1;
	transform: translateX(0);
}

.auth-toast-icon {
	flex-shrink: 0;
	margin-top: 1px;
}

.auth-toast-message {
	flex: 1;
}

.auth-toast-error {
	border-color: rgba(var(--accent-rgb), 0.35);
	color: var(--accent);
}

.auth-toast-success {
	border-color: rgba(34, 197, 94, 0.35);
	color: #22c55e;
}

.auth-toast-warning {
	border-color: rgba(245, 158, 11, 0.35);
	color: #f59e0b;
}

.auth-toast-info {
	border-color: rgba(var(--accent-2-rgb), 0.35);
	color: var(--accent-2);
}

.auth-footer-links {
	margin-top: 20px;
	text-align: center;
	font-size: 0.88rem;
	color: var(--text-muted);
}

.auth-footer-links a,
.auth-legal a {
	color: var(--accent);
	text-decoration: none;
	font-weight: 600;
}

.auth-footer-links a:hover,
.auth-legal a:hover {
	text-decoration: underline;
}

.auth-legal {
	margin-top: 14px;
	font-size: 0.8rem;
	color: var(--text-muted);
	text-align: center;
	line-height: 1.5;
}

.auth-lang-switcher {
	margin-top: 24px;
	display: flex;
	justify-content: center;
}

.auth-divider {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 18px 0;
	color: var(--text-muted);
	font-size: 0.82rem;
}

.auth-divider::before,
.auth-divider::after {
	content: '';
	flex: 1;
	height: 1px;
	background: var(--border);
}

.auth-google-btn {
	display: flex;
	justify-content: center;
}

.language-switcher--auth .language-switcher-options {
	display: flex;
	gap: 8px;
}

.language-switcher--auth .language-switcher-option {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: 999px;
	border: 1px solid var(--border);
	color: var(--text-muted);
	font-size: 0.82rem;
	font-weight: 600;
	text-decoration: none;
	transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.language-switcher--auth .language-switcher-option:hover {
	color: var(--text);
	border-color: var(--accent);
}

.language-switcher--auth .language-switcher-option.is-active {
	color: var(--text);
	border-color: var(--accent);
	background: rgba(var(--accent-rgb), 0.12);
}

.language-switcher--auth .language-switcher-flag {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

.auth-popup-overlay {
	position: fixed;
	inset: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(6, 7, 13, 0.55);
}

.auth-popup-card {
	width: 100%;
	max-width: 420px;
	backdrop-filter: none;
	background: var(--bg);
}

.auth-popup-card p {
	margin: 0 0 20px;
	font-size: 0.95rem;
	line-height: 1.5;
}

.auth-popup-actions {
	display: flex;
	gap: 12px;
}

.auth-popup-actions .auth-btn {
	width: auto;
	flex: 1;
}
