/* ==========================================================================
   LightERP Auth Pages — Shared Styles
   Used by: login.html, forgot-password.html, reset-password.html,
            change-password.html
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
	/* Brand colors */
	--color-brand-primary: #11576c;
	--color-brand-primary-hover: #0d4557;
	--color-branding-bg: #00364f;

	/* Neutral / gray scale (matches original design system) */
	--color-gray-50: #f9fafb;
	--color-gray-100: #f3f4f6;
	--color-gray-200: #e5e7eb;
	--color-gray-300: #d1d5db;
	--color-gray-400: #9ca3af;
	--color-gray-500: #6b7280;
	--color-gray-600: #4b5563;
	--color-gray-700: #374151;
	--color-gray-800: #1f2937;
	--color-gray-900: #111827;

	/* Status colors */
	--color-red-400: #f87171;
	--color-red-600: #dc2626;

	/* Typography */
	--font-family-base: system-ui, Avenir, Helvetica, Arial, sans-serif;

	/* Radii */
	--radius-md: 0.375rem;
	--radius-lg: 0.5rem;
	--radius-xl: 0.75rem;
	--radius-2xl: 1rem;

	/* Spacing helpers used repeatedly */
	--space-3_5: 0.875rem;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	padding: 0;
}

body {
	font-family: var(--font-family-base);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	color: var(--color-gray-900);
	background-color: #ffffff;
}

img,
svg {
	display: block;
	max-width: 100%;
}

button {
	font-family: inherit;
	cursor: pointer;
}

a {
	text-decoration: none;
}

/* ==========================================================================
   Page shell
   ========================================================================== */

.auth-page {
	display: flex;
	min-height: 100vh;
}

/* ==========================================================================
   Left branding panel (desktop only)
   ========================================================================== */

.auth-branding {
	display: none;
	position: relative;
	flex-direction: column;
	overflow: hidden;
}

.auth-branding__background {
	position: absolute;
	inset: 0;
	background-color: var(--color-branding-bg);
	background-image: linear-gradient(
			135deg,
			rgba(0, 54, 79, 0.9) 8.65%,
			rgba(19, 85, 111, 0.65) 54.33%,
			rgba(26, 95, 122, 0.4) 100%
		),
		url("/assets/light/assets/login-side-bg.png");
	background-size: cover, cover;
	background-position: center, center;
	background-repeat: no-repeat, no-repeat;
}

.auth-branding__content {
	position: relative;
	z-index: 10;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	height: 100%;
	padding: 2.5rem;
}

.auth-branding__top {
	display: flex;
	flex-direction: column;
	gap: 5rem;
}

.auth-branding__logo img {
	height: 3rem;
	width: auto;
}

.auth-branding__heading {
	max-width: 24rem;
}

.auth-branding__heading h1 {
	margin: 0 0 1.25rem;
	font-size: 3rem;
	font-weight: 700;
	line-height: 1.2;
	color: #ffffff;
}

.auth-branding__heading p {
	margin: 0;
	font-size: 1rem;
	line-height: 1.625;
	color: rgba(255, 255, 255, 0.75);
}

.auth-branding__quote {
	border-radius: var(--radius-2xl);
	padding: 1.25rem;
	border: 1px solid rgba(255, 255, 255, 0.2);
	background: rgba(255, 255, 255, 0.1);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
}

.auth-branding__quote p {
	margin: 0;
	max-width: 100%;
	font-size: 0.875rem;
	line-height: 1.625;
	font-style: italic;
	color: rgba(255, 255, 255, 0.9);
}

/* ==========================================================================
   Right form panel
   ========================================================================== */

.auth-panel {
	flex: 1 1 0%;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	overflow-y: auto;
	background-color: #ffffff;
	padding: 2.5rem 1.5rem;
}

.auth-container {
	width: 100%;
	max-width: 28rem;
}

/* Mobile-only logo shown above the form (hidden on desktop) */
.auth-mobile-logo {
	display: flex;
	justify-content: center;
	margin-bottom: 1.5rem;
}

.auth-mobile-logo img {
	height: 2rem;
	width: auto;
}

/* Centered logo + title block used by Forgot/Reset/Change Password pages */
.auth-logo-block {
	text-align: center;
	margin-bottom: 1.5rem;
}

.auth-logo-block__logo {
	display: flex;
	justify-content: center;
	margin-bottom: 0.75rem;
}

.auth-logo-block__logo img {
	width: 8.75rem;
	height: auto;
}

.auth-logo-block__title {
	margin: 0 0 0.25rem;
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--color-gray-900);
}

.auth-logo-block__subtitle {
	margin: 0;
	font-size: 0.875rem;
	color: var(--color-gray-600);
}

/* Heading block used on the Login page */
.auth-heading {
	text-align: center;
	margin-bottom: 2rem;
}

.auth-heading h2 {
	margin: 0 0 0.5rem;
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--color-gray-900);
}

.auth-heading p {
	margin: 0;
	font-size: 0.875rem;
	color: var(--color-gray-500);
}

/* ==========================================================================
   Forms
   ========================================================================== */

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

.form-group {
	width: 100%;
}

.form-group__label {
	display: block;
	margin-bottom: 0.5rem;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--color-gray-900);
}

.required-indicator {
	color: var(--color-red-600);
	margin-inline-start: 0.125rem;
}

.input-wrapper {
	position: relative;
}

.input-wrapper__icon {
	position: absolute;
	left: var(--space-3_5);
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	color: var(--color-gray-400);
	pointer-events: none;
}

.input-wrapper__icon svg {
	width: 1.125rem;
	height: 1.125rem;
}

.auth-input {
	width: 100%;
	padding: 0.625rem var(--space-3_5);
	border: 1px solid var(--color-gray-300);
	border-radius: var(--radius-lg);
	outline: none;
	font-size: 0.875rem;
	background-color: #ffffff;
	color: var(--color-gray-900);
	transition: all 0.15s ease;
	direction: ltr;
	text-align: left;
}

.auth-input::placeholder {
	color: var(--color-gray-400);
}

.auth-input:hover {
	border-color: var(--color-gray-400);
}

.auth-input:focus {
	border-color: var(--color-brand-primary);
	box-shadow: 0 0 0 2px rgba(17, 87, 108, 0.35);
}

.auth-input--with-icon {
	padding-left: 2.5rem;
}

.auth-input--with-toggle {
	padding-right: 2.5rem;
}

.auth-input--error {
	border-color: var(--color-red-400);
}

/* Hide native browser password reveal/clear icons so our custom toggle
   is the only one visible (matches original component behavior). */
.auth-input::-ms-reveal,
.auth-input::-ms-clear {
	display: none;
}

.auth-input::-webkit-credentials-auto-fill-button,
.auth-input::-webkit-contacts-auto-fill-button {
	display: none !important;
}

.password-toggle {
	position: absolute;
	right: var(--space-3_5);
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	background: none;
	border: none;
	padding: 0;
	color: var(--color-gray-400);
	transition: color 0.15s ease;
}

.password-toggle:hover {
	color: var(--color-gray-600);
}

.password-toggle svg {
	width: 1.25rem;
	height: 1.25rem;
}

/* Show only one of the two eye icons at a time. Toggling which icon is
   visible requires JavaScript in a live app; both are included here so the
   markup/styling can be wired up later. */
.password-toggle .icon-eye-off {
	display: none;
}

.field-error {
	margin-top: 0.375rem;
	font-size: 0.875rem;
	color: var(--color-red-600);
}

/* ---------- Checkbox row (Remember me) ---------- */

.auth-checkbox-row {
	display: flex;
	align-items: center;
	font-size: 0.875rem;
	padding-top: 0.25rem;
}

.auth-checkbox-label {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	cursor: pointer;
}

.auth-checkbox-label input[type="checkbox"] {
	width: 1rem;
	height: 1rem;
	border-radius: 0.25rem;
	border: 1px solid var(--color-gray-300);
	accent-color: var(--color-brand-primary);
	cursor: pointer;
}

.auth-checkbox-label span {
	color: var(--color-gray-600);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.auth-button {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	font-size: 1rem;
	font-weight: 600;
	padding: 0.625rem 1rem;
	border-radius: var(--radius-md);
	border: 1px solid transparent;
	transition: all 0.2s ease;
}

.auth-button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.auth-button--primary {
	background-color: var(--color-brand-primary);
	color: #ffffff;
	box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.auth-button--primary:hover:not(:disabled) {
	background-color: var(--color-brand-primary-hover);
}

.auth-button--secondary {
	background-color: var(--color-gray-200);
	color: var(--color-gray-800);
}

.auth-button--secondary:hover:not(:disabled) {
	background-color: var(--color-gray-300);
}

.auth-button--outline {
	background-color: #ffffff;
	border-color: var(--color-gray-300);
	color: var(--color-gray-700);
}

.auth-button--outline:hover:not(:disabled) {
	background-color: var(--color-gray-50);
}

.auth-button-group {
	display: flex;
	gap: 0.75rem;
	padding-top: 0.25rem;
}

.auth-button-group .auth-button {
	flex: 1 1 0%;
}

/* Single full-width button (Forgot Password / Reset Password submit) */
.auth-button-group--single {
	display: block;
}

.auth-button-group--single .auth-button {
	flex: none;
}

.auth-spinner {
	width: 1rem;
	height: 1rem;
	animation: auth-spin 0.75s linear infinite;
}

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

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

.auth-footer {
	margin-top: auto;
	padding-top: 1.5rem;
	border-top: 1px solid var(--color-gray-100);
}

.auth-footer p {
	margin: 0;
	text-align: center;
	font-size: 0.875rem;
	color: var(--color-gray-700);
}

.auth-footer a {
	color: var(--color-brand-primary);
	font-weight: 600;
	transition: color 0.15s ease;
}

.auth-footer a:hover {
	color: var(--color-brand-primary-hover);
}

/* ==========================================================================
   Social login (divider + provider buttons)
   ========================================================================== */

.auth-social {
	margin-top: 1.5rem;
}

.auth-divider {
	position: relative;
	margin: 1.5rem 0;
	display: flex;
	justify-content: center;
}

.auth-divider::before {
	content: "";
	position: absolute;
	inset: 0;
	top: 50%;
	border-top: 1px solid var(--color-gray-200);
}

.auth-divider span {
	position: relative;
	padding: 0 0.75rem;
	background-color: #ffffff;
	font-size: 0.75rem;
	font-weight: 500;
	color: var(--color-gray-400);
}

.auth-social-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
}

.auth-social-button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.625rem 1rem;
	border: 1px solid var(--color-gray-300);
	border-radius: var(--radius-lg);
	background-color: #ffffff;
	box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--color-gray-700);
	transition: all 0.15s ease;
}

.auth-social-button:hover {
	background-color: var(--color-gray-50);
	border-color: var(--color-gray-400);
}

.auth-social-button svg {
	width: 1.125rem;
	height: 1.125rem;
	flex-shrink: 0;
}

/* ==========================================================================
   Responsive breakpoints
   ========================================================================== */

/* sm */
@media (min-width: 640px) {
	.auth-panel {
		padding-inline: 2.5rem;
	}
}

/* lg — reveal branding panel, hide mobile-only logo */
@media (min-width: 1024px) {
	.auth-branding {
		display: flex;
		width: 50%;
	}

	.auth-mobile-logo {
		display: none;
	}
}
