/**
 * Modern Login Page Styles - Beautiful & Responsive
 * Bicol Tenese Trading Corporation
 * Version: 3.0 - Modernized Design
 * Updated: 2025-11-16
 */

/* ========================================
   CSS CUSTOM PROPERTIES
   ======================================== */

:root {
	/* Primary Colors - Matching system bright blue */
	--primary-color: #0284c7;
	--primary-dark: #0369a1;
	--primary-light: #0ea5e9;

	/* Semantic Colors */
	--success-color: #10b981;
	--error-color: #ef4444;
	--warning-color: #f59e0b;
	--info-color: #0284c7;

	/* Text Colors */
	--text-primary: #1f2937;
	--text-secondary: #6b7280;
	--text-muted: #9ca3af;

	/* Background Colors */
	--bg-primary: #ffffff;
	--bg-secondary: #f3f4f6;
	--border-color: #e5e7eb;

	/* Shadows */
	--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
	--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
	--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
	--shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ========================================
   RESET & BASE STYLES
   ======================================== */

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html {
	font-size: 16px;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	padding: 1rem;
	color: var(--text-primary);
	position: relative;
	overflow-x: hidden;
}

/* Decorative background pattern */
body::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-image:
		radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
		radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
	pointer-events: none;
	z-index: 0;
}

/* Wrapper */
#wrapper {
	position: relative;
	z-index: 1;
	width: 100%;
	display: flex;
	justify-content: center;
	align-items: center;
}

/* Skip link for accessibility */
.skip-link {
	position: absolute;
	top: -40px;
	left: 0;
	background: var(--primary-color);
	color: white;
	padding: 8px 16px;
	text-decoration: none;
	z-index: 100;
}

.skip-link:focus {
	top: 0;
}

/* ========================================
   LOGIN CONTAINER
   ======================================== */

.login-container {
	background: var(--bg-primary);
	border-radius: 1rem;
	box-shadow: var(--shadow-xl);
	width: 100%;
	max-width: 420px;
	padding: 2.5rem 2rem;
	position: relative;
	animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ========================================
   HEADER
   ======================================== */

.login-header {
	text-align: center;
	margin-bottom: 2rem;
}

.login-title {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
}

.login-title::before {
	content: "BT";
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
	border-radius: 1rem;
	font-size: 2rem;
	font-weight: bold;
	color: white;
	box-shadow: var(--shadow-md);
	margin-bottom: 0.5rem;
}

.company-name {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--text-primary);
	line-height: 1.3;
}

.login-subtitle {
	font-size: 0.875rem;
	color: var(--text-secondary);
	font-weight: 500;
}

/* ========================================
   MESSAGES
   ======================================== */

.message-container {
	padding: 1rem;
	border-radius: 0.5rem;
	margin-bottom: 1.5rem;
	font-size: 0.875rem;
	line-height: 1.5;
	border: 1px solid;
}

.message-container.message-info {
	background-color: #dbeafe;
	border-color: #93c5fd;
	color: #1e40af;
}

.message-container.message-error {
	background-color: #fee2e2;
	border-color: #fca5a5;
	color: #991b1b;
}

.message-content h3 {
	font-size: 1rem;
	font-weight: 600;
	margin-bottom: 0.5rem;
}

.message-content p {
	margin-top: 0.5rem;
}

/* ========================================
   FORM STYLES
   ======================================== */

.login-form {
	width: 100%;
}

.form-group {
	margin-bottom: 1.25rem;
}

.form-label {
	display: block;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--text-primary);
	margin-bottom: 0.5rem;
}

.required {
	color: var(--error-color);
	margin-left: 0.25rem;
}

.keyboard-hint {
	font-size: 0.75rem;
	color: var(--text-muted);
	float: right;
	margin-top: 0.25rem;
}

/* Input fields */
.form-input {
	width: 100%;
	padding: 0.75rem 1rem;
	border: 2px solid var(--border-color);
	border-radius: 0.5rem;
	font-size: 1rem;
	transition: all 0.2s ease;
	background: var(--bg-primary);
	color: var(--text-primary);
	font-family: inherit;
}

.form-input:focus {
	outline: none;
	border-color: var(--primary-color);
	box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
}

.form-input::placeholder {
	color: var(--text-secondary);
}

.form-input:invalid {
	border-color: var(--error-color);
}

/* Password wrapper */
.password-wrapper {
	position: relative;
}

.password-wrapper .form-input {
	padding-right: 3.5rem;
}

/* Password toggle button (added by JavaScript) */
.password-toggle {
	position: absolute;
	right: 1rem;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	color: var(--text-secondary);
	cursor: pointer;
	padding: 0.25rem 0.5rem;
	font-size: 0.875rem;
	transition: color 0.2s ease;
	z-index: 2;
	min-height: 44px; /* Touch target */
	min-width: 44px;
}

.password-toggle:hover {
	color: var(--primary-color);
}

.password-toggle:focus {
	outline: 2px solid var(--primary-color);
	outline-offset: 2px;
	border-radius: 0.25rem;
	color: var(--primary-color);
}

/* ========================================
   BUTTONS
   ======================================== */

.form-actions {
	display: flex;
	gap: 0.75rem;
	margin-top: 1.5rem;
}

.btn {
	flex: 1;
	padding: 0.75rem 1.5rem;
	border: none;
	border-radius: 0.5rem;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	position: relative;
	overflow: hidden;
	font-family: inherit;
	min-height: 44px; /* Touch target */
}

.btn:focus {
	outline: 2px solid var(--primary-color);
	outline-offset: 2px;
}

.btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.btn-primary {
	background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
	color: white;
	box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
	transform: translateY(-2px);
	box-shadow: var(--shadow-md);
}

.btn-primary:active:not(:disabled) {
	transform: translateY(0);
}

.btn-secondary {
	background: var(--bg-secondary);
	color: var(--text-primary);
	border: 2px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
	background: var(--border-color);
	border-color: var(--text-secondary);
}

/* Loading state */
.btn.loading {
	pointer-events: none;
	opacity: 0.7;
}

.btn.loading::after {
	content: "";
	position: absolute;
	width: 16px;
	height: 16px;
	top: 50%;
	left: 50%;
	margin-left: -8px;
	margin-top: -8px;
	border: 2px solid transparent;
	border-top-color: white;
	border-radius: 50%;
	animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
	to { transform: rotate(360deg); }
}

/* ========================================
   LOGIN INFO & FOOTER
   ======================================== */

.login-info {
	margin-top: 1.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--border-color);
}

.security-notice {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	font-size: 0.75rem;
	color: var(--text-secondary);
}

.security-notice .icon {
	flex-shrink: 0;
}

.noscript-notice {
	margin-top: 1rem;
	padding: 0.75rem;
	background: #fef3c7;
	border: 1px solid #fbbf24;
	border-radius: 0.5rem;
	font-size: 0.875rem;
	color: #92400e;
}

.login-footer {
	position: fixed;
	bottom: 1rem;
	left: 0;
	right: 0;
	text-align: center;
	color: rgba(255, 255, 255, 0.9);
	font-size: 0.875rem;
	z-index: 0;
}

.login-footer p {
	margin: 0.25rem 0;
}

.footer-meta {
	font-size: 0.75rem;
	opacity: 0.8;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 480px) {
	body {
		padding: 0.5rem;
	}

	.login-container {
		padding: 2rem 1.5rem;
	}

	.company-name {
		font-size: 1.25rem;
	}

	.login-title::before {
		width: 56px;
		height: 56px;
		font-size: 1.75rem;
	}

	.form-actions {
		flex-direction: column-reverse;
	}

	.btn {
		width: 100%;
	}
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* High contrast mode support */
@media (prefers-contrast: high) {
	.login-container {
		border: 2px solid currentColor;
	}

	.form-input {
		border-width: 3px;
	}

	.btn {
		border: 2px solid currentColor;
	}
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* Focus visible (keyboard navigation) */
*:focus-visible {
	outline: 2px solid var(--primary-color);
	outline-offset: 2px;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
	body {
		background: white !important;
	}

	body::before {
		display: none;
	}

	.login-container {
		box-shadow: none !important;
		border: 1px solid #000;
		page-break-inside: avoid;
	}

	.login-footer {
		page-break-after: avoid;
		position: relative;
		color: #000;
	}

	.password-toggle,
	.keyboard-hint {
		display: none;
	}
}
