<!doctype html>
<html lang="id">

<head>
	<title>Login</title>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

	<!-- Google Font -->
	<link href="https://fonts.googleapis.com/css?family=Lato:300,400,700&display=swap" rel="stylesheet">

	<!-- Font Awesome -->
	<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">

	<!-- Bootstrap -->
	<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">

	<!-- CUSTOM CSS -->
	<style>
		:root {
			--primary-color: #4e73df;
		}

		body {
			font-family: 'Lato', sans-serif;
		}

		.ftco-section {
			min-height: 100vh;
			display: flex;
			align-items: center;
		}

		.login-wrap {
			border-radius: 12px;
		}

		/* Icon */
		.icon {
			width: 80px;
			height: 80px;
			border-radius: 50%;
			background: var(--primary-color);
			color: #fff;
			font-size: 30px;
		}

		/* Button */
		.btn-primary {
			background-color: var(--primary-color);
			border-color: var(--primary-color);
		}

		.btn-primary:hover {
			background-color: #2e59d9;
			border-color: #2e59d9;
		}

		/* Link */
		a {
			color: var(--primary-color);
		}

		a:hover {
			color: #2e59d9;
			text-decoration: none;
		}

		/* Checkbox */
		.checkbox-wrap {
			position: relative;
			padding-left: 25px;
			cursor: pointer;
			font-size: 14px;
		}

		.checkbox-wrap input {
			position: absolute;
			opacity: 0;
		}

		.checkmark {
			position: absolute;
			top: 2px;
			left: 0;
			height: 16px;
			width: 16px;
			background-color: #eee;
			border-radius: 4px;
		}

		.checkbox-wrap input:checked~.checkmark {
			background-color: var(--primary-color);
		}

		.checkmark:after {
			content: "";
			position: absolute;
			display: none;
		}

		.checkbox-wrap input:checked~.checkmark:after {
			display: block;
		}

		.checkbox-wrap .checkmark:after {
			left: 5px;
			top: 2px;
			width: 5px;
			height: 9px;
			border: solid white;
			border-width: 0 2px 2px 0;
			transform: rotate(45deg);
		}
	</style>
</head>

<body>

	<section class="ftco-section bg-light">
		<div class="container">
			<div class="row justify-content-center">
				<div class="col-md-7 col-lg-5">
					<div class="login-wrap p-4 p-md-5 shadow bg-white rounded">

						<!-- Icon -->
						<div class="icon d-flex align-items-center justify-content-center mb-3 mx-auto">
							<span class="fa fa-envelope"></span>
						</div>

						<!-- Title -->
						<h3 class="text-center mb-2 font-weight-bold">
							Sistem Informasi e-Surat
						</h3>
						<p class="text-center text-muted mb-4">
							Silakan login untuk mengakses layanan surat
						</p>

						<!-- Form -->
						@if ($errors->has('login'))
						<div class="alert alert-danger">
							{{ $errors->first('login') }}
						</div>
						@endif

						<form action="{{ route('login.process') }}" method="POST" class="login-form">
							@csrf

							<!-- Username -->
							<div class="form-group">
								<label>Username</label>
								<input type="text" name="username" class="form-control" required>
							</div>

							<div class="form-group">
								<label>Password</label>
								<input type="password" name="password" class="form-control" required>
							</div>

							<!-- Remember & Forgot -->
							<div class="form-group d-flex justify-content-between align-items-center">
								<label class="checkbox-wrap mb-0">
									Ingat Saya
									<input type="checkbox" name="remember">
									<span class="checkmark"></span>
								</label>

								<a href="{{ route('password.request') }}" class="text-muted small">
									Lupa Password?
								</a>
							</div>

							<!-- Button (WAJIB BUTTON SUBMIT) -->
							<div class="form-group mt-4">
								<button type="submit" class="btn btn-primary btn-block">
									Masuk
								</button>
							</div>
						</form>


						<!-- Daftar Akun -->
						<p class="text-center mt-3">
							Belum punya akun?
							<a href="{{ route('daftar') }}" class="font-weight-bold">
								Daftar Akun
							</a>
						</p>

						<!-- Footer -->
						<p class="text-center mt-4 text-muted small">
							© 2026 Sistem Layanan Surat Desa
						</p>

					</div>
				</div>
			</div>
		</div>
	</section>

	<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
	<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.2/dist/js/bootstrap.bundle.min.js"></script>

</body>

</html>