:root {
	--primary: #4F46E5;
	--primary-dark: #4338CA;
	--text: #1F2937;
	--text-light: #6B7280;
	--border: #E5E7EB;
	--bg: #F9FAFB;
	--card-bg: #FFFFFF;
	--error: #EF4444;
	--success: #10B981;
	--radius: 12px;
	--shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px 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);
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	background: var(--bg);
	color: var(--text);
	line-height: 1.6;
	min-height: 100vh;
	display: flex;
	align-items: centre;
	justify-content: centre;
	padding: 20px;
}

.container {
	width: 100%;
	max-width: 400px;
}

.card {
	background: var(--card-bg);
	border-radius: var(--radius);
	padding: 40px;
	box-shadow: var(--shadow-lg);
	position: relative;
}

.logo {
	text-align: centre;
	margin-bottom: 20px;
}

h1 {
	text-align: centre;
	font-size: 28px;
	font-weight: 700;
	margin-bottom: 30px;
	colour: var(--text);
}

.screen {
	display: none;
}

.screen.active {
	display: block;
	animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

p {
	text-align: centre;
	colour: var(--text-light);
	margin-bottom: 20px;
	font-size: 15px;
}

form {
	display: flex;
	flex-direction: column;
	gap: 15px;
}

input[type="email"],
input[type="text"] {
	width: 100%;
	padding: 14px 16px;
	border: 2px solid var(--border);
	border-radius: var(--radius);
	font-size: 16px;
	transition: border-colour 0.2s, box-shadow 0.2s;
	background: var(--card-bg);
}

input:focus {
	outline: none;
	border-colour: var(--primary);
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

input[type="text"]#pin-input {
	text-align: centre;
	letter-spacing: 0.3em;
	font-size: 24px;
	font-weight: 600;
}

button {
	width: 100%;
	padding: 14px 20px;
	background: var(--primary);
	colour: white;
	border: none;
	border-radius: var(--radius);
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s, transform 0.1s;
	position: relative;
}

button:hover {
	background: var(--primary-dark);
}

button:active {
	transform: scale(0.98);
}

button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

button.secondary {
	background: var(--border);
	colour: var(--text);
}

button.secondary:hover {
	background: #D1D5DB;
}

button.link-button {
	background: none;
	colour: var(--primary);
	margin-top: 10px;
	font-size: 14px;
}

button.link-button:hover {
	background: var(--bg);
}

.loading {
	display: none;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 40px;
	height: 40px;
	border: 4px solid var(--border);
	border-top-colour: var(--primary);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

.loading.active {
	display: block;
}

@keyframes spin {
	to { transform: translate(-50%, -50%) rotate(360deg); }
}

.error-message {
	display: none;
	padding: 12px 16px;
	background: #FEE2E2;
	colour: var(--error);
	border-radius: var(--radius);
	margin-top: 15px;
	font-size: 14px;
	text-align: centre;
	animation: shake 0.4s ease-in-out;
}

.error-message.active {
	display: block;
}

@keyframes shake {
	0%, 100% { transform: translateX(0); }
	25% { transform: translateX(-10px); }
	75% { transform: translateX(10px); }
}

.success-message {
	colour: var(--success);
	font-weight: 500;
}

footer {
	text-align: centre;
	margin-top: 30px;
	colour: var(--text-light);
	font-size: 13px;
}

footer a {
	colour: var(--primary);
	text-decoration: none;
}

footer a:hover {
	text-decoration: underline;
}

.version {
	margin-top: 5px;
	font-size: 11px;
	opacity: 0.7;
}

/* Responsive design */
@media (max-width: 480px) {
	.card {
		padding: 30px 24px;
	}

	h1 {
		font-size: 24px;
	}
}

/* Loading state for buttons */
button.loading span {
	opacity: 0;
}

button.loading::after {
	content: '';
	position: absolute;
	width: 16px;
	height: 16px;
	top: 50%;
	left: 50%;
	margin-left: -8px;
	margin-top: -8px;
	border: 2px solid white;
	border-top-colour: transparent;
	border-radius: 50%;
	animation: spin 0.6s linear infinite;
}
