*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root 
{
	--orange-primary: #D4691E;
	--orange-bright: #E8852A;
	--orange-light: #F2A65A;
	--brown-dark: #2B1810;
	--brown-mid: #4A2C1A;
	--brown-warm: #6B3A24;
	--cream: #FDF5ED;
	--cream-dark: #F5E6D3;
	--cream-mid: #FAF0E6;
	--gold: #C8982C;
	--gold-light: #E8C060;
	--white: #FFFFFF;
	--text-dark: #1A0E08;
	--text-body: #3D2518;
	--text-muted: #7A5F4F;
	--shadow-soft: 0 4px 20px rgba(43, 24, 16, 0.08);
	--shadow-md: 0 8px 32px rgba(43, 24, 16, 0.12);
	--shadow-lg: 0 16px 48px rgba(43, 24, 16, 0.16);
	--radius-sm: 6px;
	--radius-md: 12px;
	--radius-lg: 20px;
	--transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; height: 100%; }

body 
{
	font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
	color: var(--text-body);
	background: var(--brown-dark);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	line-height: 1.7;
	overflow-x: hidden;
}

h1, h2, h3, h4 
{
	font-family: 'Playfair Display', Georgia, serif;
	color: var(--brown-dark);
	line-height: 1.25;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }


/* ===== PAGE LAYOUT ===== */
.login-page 
{
	flex: 1;
	display: grid;
	grid-template-columns: 1fr 1fr;
	min-height: 100vh;
}


/* ===== LEFT PANEL — BRANDING ===== */
.login-brand 
{
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	padding: 60px 48px;
	background: linear-gradient(165deg, #1a0e08 0%, var(--brown-dark) 40%, var(--brown-mid) 100%);
	overflow: hidden;
	text-align: center;
}


/* Decorative orbs */
.login-brand::before 
{
	content: '';
	position: absolute;
	top: -15%;
	left: -15%;
	width: 500px;
	height: 500px;
	background: radial-gradient(circle, rgba(212,105,30,0.12) 0%, transparent 65%);
	border-radius: 50%;
	pointer-events: none;
}

.login-brand::after 
{
	content: '';
	position: absolute;
	bottom: -20%;
	right: -10%;
	width: 450px;
	height: 450px;
	background: radial-gradient(circle, rgba(200,152,44,0.08) 0%, transparent 60%);
	border-radius: 50%;
	pointer-events: none;
}


/* Gear pattern texture */
.brand-texture 
{
	position: absolute;
	inset: 0;
	background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.015'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
	pointer-events: none;
}

.brand-content 
{
	position: relative;
	z-index: 2;
	max-width: 420px;
}

.brand-logo-wrap 
{
	position: relative;
	width: 180px;
	height: 180px;
	margin: 0 auto 40px;
}

.brand-logo-wrap img 
{
	width: 100%;
	height: 100%;
	object-fit: contain;
	filter: drop-shadow(0 16px 40px rgba(212,105,30,0.25));
	animation: logoIn 1s ease-out 0.2s both;
}

.brand-logo-ring 
{
	position: absolute;
	inset: -20px;
	border: 1.5px dashed rgba(212,105,30,0.15);
	border-radius: 50%;
	animation: spin-slow 80s linear infinite;
}

@keyframes spin-slow { to { transform: rotate(360deg); } }

@keyframes logoIn 
{
	from { opacity: 0; transform: scale(0.85) translateY(20px); }
	to { opacity: 1; transform: scale(1) translateY(0); }
}

.brand-title 
{
	font-family: 'Playfair Display', serif;
	font-size: 1.6rem;
	font-weight: 700;
	color: var(--cream);
	margin-bottom: 8px;
	letter-spacing: 0.5px;
	animation: fadeUp 0.8s ease-out 0.4s both;
}

.brand-subtitle 
{
	font-family: 'Cormorant Garamond', serif;
	font-size: 1rem;
	font-weight: 500;
	color: var(--orange-light);
	letter-spacing: 4px;
	text-transform: uppercase;
	margin-bottom: 32px;
	animation: fadeUp 0.8s ease-out 0.5s both;
}

.brand-desc 
{
	font-size: 0.92rem;
	color: rgba(253,245,237,0.55);
	line-height: 1.8;
	max-width: 360px;
	margin: 0 auto 48px;
	animation: fadeUp 0.8s ease-out 0.6s both;
}


/* Stats row */
.brand-stats 
{
	display: flex;
	justify-content: center;
	gap: 36px;
	padding-top: 36px;
	border-top: 1px solid rgba(253,245,237,0.06);
	animation: fadeUp 0.8s ease-out 0.7s both;
}

.brand-stat-num 
{
	font-family: 'Source Sans 3', sans-serif;
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--orange-light);
	display: block;
}

.brand-stat-label 
{
	font-size: 0.72rem;
	color: rgba(253,245,237,0.4);
	text-transform: uppercase;
	letter-spacing: 1.5px;
	font-weight: 600;
}


/* ===== RIGHT PANEL — FORM ===== */
.login-form-panel 
{
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	padding: 60px 48px;
	background: var(--cream);
	position: relative;
	overflow: hidden;
}

.login-form-panel::before 
{
	content: '';
	position: absolute;
	top: -100px;
	right: -100px;
	width: 350px;
	height: 350px;
	background: radial-gradient(circle, rgba(212,105,30,0.04) 0%, transparent 70%);
	border-radius: 50%;
	pointer-events: none;
}

.form-container 
{
	width: 100%;
	max-width: 420px;
	position: relative;
	z-index: 2;
	animation: formIn 0.9s ease-out 0.3s both;
}

@keyframes formIn 
{
	from { opacity: 0; transform: translateY(30px); }
	to { opacity: 1; transform: translateY(0); }
}


/* Back to home link */
.back-home 
{
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--text-muted);
	margin-bottom: 40px;
	transition: var(--transition);
}

.back-home:hover { color: var(--orange-primary); }

.back-home svg 
{
	width: 16px;
	height: 16px;
	transition: transform var(--transition);
}

.back-home:hover svg { transform: translateX(-3px); }


/* Form header */
.form-header { margin-bottom: 36px; }

.form-header h1 
{
	font-size: 2rem;
	font-weight: 800;
	margin-bottom: 8px;
	color: var(--brown-dark);
}

.form-header h1 span 
{
	background: linear-gradient(135deg, var(--orange-primary), var(--brown-warm));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.form-header p 
{
	font-size: 0.95rem;
	color: var(--text-muted);
}


/* Form fields */
.field-group 
{
	margin-bottom: 22px;
	position: relative;
}

.field-label 
{
	display: block;
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--text-body);
	margin-bottom: 8px;
	letter-spacing: 0.5px;
	text-transform: uppercase;
}

.field-wrap 
{
	position: relative;
	display: flex;
	align-items: center;
}

.field-icon 
{
	position: absolute;
	left: 16px;
	width: 20px;
	height: 20px;
	color: var(--text-muted);
	pointer-events: none;
	transition: color var(--transition);
	z-index: 2;
}

.field-wrap input 
{
	width: 100%;
	padding: 15px 16px 15px 48px;
	border: 2px solid rgba(43,24,16,0.08);
	border-radius: 14px;
	font-family: 'Source Sans 3', sans-serif;
	font-size: 0.95rem;
	color: var(--text-dark);
	background: var(--white);
	transition: var(--transition);
	outline: none;
}

.field-wrap input::placeholder { color: #bba898; }

.field-wrap input:focus 
{
	border-color: var(--orange-primary);
	box-shadow: 0 0 0 4px rgba(212,105,30,0.08);
}

.field-wrap input:focus ~ .field-icon,
.field-wrap input:focus + .field-icon 
{
	color: var(--orange-primary);
}


/* Fix: icon color on focus via sibling selector */
.field-wrap:focus-within .field-icon 
{
	color: var(--orange-primary);
}


/* Password toggle */
.pw-toggle 
{
	position: absolute;
	right: 16px;
	background: none;
	border: none;
	cursor: pointer;
	color: var(--text-muted);
	padding: 4px;
	display: flex;
	align-items: center;
	transition: color var(--transition);
	z-index: 2;
}

.pw-toggle:hover { color: var(--orange-primary); }
.pw-toggle svg { width: 20px; height: 20px; }


/* Remember & Forgot */
.field-extras 
{
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 28px;
}

.remember-me 
{
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-size: 0.85rem;
	color: var(--text-body);
	user-select: none;
}

.remember-me input[type="checkbox"] 
{
	appearance: none;
	-webkit-appearance: none;
	width: 20px;
	height: 20px;
	border: 2px solid rgba(43,24,16,0.12);
	border-radius: 6px;
	cursor: pointer;
	position: relative;
	transition: var(--transition);
	flex-shrink: 0;
}

.remember-me input[type="checkbox"]:checked 
{
	background: var(--orange-primary);
	border-color: var(--orange-primary);
}

.remember-me input[type="checkbox"]:checked::after 
{
	content: '';
	position: absolute;
	top: 3px;
	left: 6px;
	width: 5px;
	height: 9px;
	border: 2px solid var(--white);
	border-top: none;
	border-left: none;
	transform: rotate(45deg);
}

.forgot-link 
{
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--orange-primary);
	transition: var(--transition);
}

.forgot-link:hover { color: var(--brown-warm); }


/* Submit button */
.btn-login 
{
	width: 100%;
	padding: 17px 32px;
	border: none;
	border-radius: 14px;
	font-family: 'Source Sans 3', sans-serif;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.5px;
	cursor: pointer;
	position: relative;
	overflow: hidden;
	transition: var(--transition);
	background: linear-gradient(135deg, var(--orange-primary) 0%, var(--brown-warm) 100%);
	color: var(--white);
	box-shadow: 0 6px 24px rgba(212,105,30,0.3);
}

.btn-login:hover 
{
	transform: translateY(-2px);
	box-shadow: 0 10px 32px rgba(212,105,30,0.4);
}

.btn-login:active { transform: translateY(0); }


/* Shimmer on button */
.btn-login::after 
{
	content: '';
	position: absolute;
	top: -50%;
	left: -50%;
	width: 200%;
	height: 200%;
	background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.12) 50%, transparent 70%);
	transition: none;
	animation: btn-shimmer 4s ease-in-out infinite;
}

@keyframes btn-shimmer 
{
	0% { transform: translateX(-100%); }
	100% { transform: translateX(100%); }
}

.btn-login .btn-text { position: relative; z-index: 2; }


/* Loading spinner inside button */
.btn-login .spinner 
{
	display: none;
	width: 22px;
	height: 22px;
	border: 3px solid rgba(255,255,255,0.3);
	border-top-color: var(--white);
	border-radius: 50%;
	animation: spin 0.7s linear infinite;
	margin: 0 auto;
	position: relative;
	z-index: 2;
}

.btn-login.loading .btn-text { display: none; }
.btn-login.loading .spinner { display: block; }
.btn-login.loading { pointer-events: none; }

@keyframes spin { to { transform: rotate(360deg); } }


/* Divider */
.divider 
{
	display: flex;
	align-items: center;
	gap: 16px;
	margin: 28px 0;
}

.divider::before,
.divider::after 
{
	content: '';
	flex: 1;
	height: 1px;
	background: rgba(43,24,16,0.08);
}

.divider span 
{
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: 1.5px;
}


/* Social / Alt buttons */
.alt-actions 
{
	display: flex;
	gap: 12px;
}

.btn-alt 
{
	flex: 1;
	padding: 14px;
	border: 2px solid rgba(43,24,16,0.07);
	border-radius: 14px;
	background: var(--white);
	font-family: 'Source Sans 3', sans-serif;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--text-body);
	cursor: pointer;
	transition: var(--transition);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.btn-alt:hover 
{
	border-color: var(--orange-primary);
	background: rgba(212,105,30,0.03);
	transform: translateY(-2px);
	box-shadow: var(--shadow-soft);
}

.btn-alt svg { width: 20px; height: 20px; }


/* Sign-up prompt */
.signup-prompt 
{
	text-align: center;
	margin-top: 32px;
	font-size: 0.9rem;
	color: var(--text-muted);
}

.signup-prompt a 
{
	color: var(--orange-primary);
	font-weight: 700;
	transition: var(--transition);
}

.signup-prompt a:hover { color: var(--brown-warm); }


/* Error/Success toast */
.toast 
{
	position: fixed;
	top: 24px;
	right: 24px;
	padding: 16px 24px;
	border-radius: 14px;
	font-size: 0.88rem;
	font-weight: 600;
	font-family: 'Source Sans 3', sans-serif;
	z-index: 9999;
	opacity: 0;
	transform: translateY(-16px) scale(0.96);
	transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	pointer-events: none;
	box-shadow: var(--shadow-lg);
}

.toast.show 
{
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.toast.error 
{
	background: #FFF0F0;
	color: #B71C1C;
	border: 1px solid rgba(183,28,28,0.1);
}

.toast.success 
{
	background: #F0FFF4;
	color: #1B5E20;
	border: 1px solid rgba(27,94,32,0.1);
}


/* ===== ANIMATIONS ===== */
@keyframes fadeUp 
{
	from { opacity: 0; transform: translateY(24px); }
	to { opacity: 1; transform: translateY(0); }
}


/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) 
{
	.login-page { grid-template-columns: 1fr; }

	.login-brand 
	{
		display: none;
	}

	.login-form-panel { padding: 40px 24px; }

	.form-container { max-width: 460px; }

	/* Show a compact brand header on mobile */
	.mobile-brand 
	{
		display: flex !important;
		align-items: center;
		gap: 14px;
		margin-bottom: 36px;
		padding-bottom: 28px;
		border-bottom: 1px solid rgba(43,24,16,0.06);
	}

	.mobile-brand img 
	{
		width: 52px;
		height: 52px;
		object-fit: contain;
	}

	.mobile-brand-text .mb-name 
	{
		font-family: 'Playfair Display', serif;
		font-size: 1.1rem;
		font-weight: 700;
		color: var(--brown-dark);
		display: block;
	}

	.mobile-brand-text .mb-sub 
	{
		font-size: 0.68rem;
		font-weight: 600;
		color: var(--text-muted);
		letter-spacing: 1.5px;
		text-transform: uppercase;
	}
}

.field-group.field-error .field-wrap
{
    border-color: #D32F2F;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

/* Google Login Loading State */
.btn-alt.loading .btn-alt-text { visibility: hidden; }
.btn-alt.loading .spinner-alt { display: block; }
.btn-alt.loading svg:first-child { display: none; }
.spinner-alt { display: none; }

@media (min-width: 1025px) 
{
	.mobile-brand { display: none !important; }
}

@media (max-width: 480px) 
{
	.login-form-panel { padding: 32px 16px; }

	.form-header h1 { font-size: 1.65rem; }

	.alt-actions { flex-direction: column; }

	.field-extras { flex-direction: column; gap: 12px; align-items: flex-start; }
}