<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Login - Kos Calista</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css" rel="stylesheet">
    <style>
        body {
            background: linear-gradient(to bottom, #acccf4, #ffffff);
            font-family: 'Poppins', sans-serif;
        }

        .login-card {
            max-width: 420px;
            background: #ffffff;
            border-radius: 20px;
            padding: 30px;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        }

        .login-title {
            font-weight: bold;
            text-align: center;
            background: linear-gradient(to right, #007bff, #00bcd4);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            font-size: 32px;
            margin-bottom: 25px;
        }

        .btn-gradient {
            background: linear-gradient(to right, #007bff, #00bcd4);
            border: none;
            color: white;
            font-weight: 600;
            padding: 10px;
            border-radius: 50px;
            transition: 0.3s ease;
        }

        .btn-gradient:hover {
            background: linear-gradient(to bottom, #60a5fa, #ffffff);
            color: #000;
            transform: scale(1.03);
        }

        .form-label {
            font-weight: 500;
        }

        .form-control {
            border-radius: 10px;
        }

        .input-group .btn {
            border-top-left-radius: 0;
            border-bottom-left-radius: 0;
        }

        .forgot-link {
            font-size: 0.9rem;
            color: #007bff;
            text-decoration: none;
        }

        .forgot-link:hover {
            text-decoration: underline;
        }
    </style>
</head>
<body class="d-flex justify-content-center align-items-center vh-100">

    <div class="login-card">
        <h2 class="login-title">Login</h2>

        @if(session('success'))
            <div class="alert alert-success text-center">{{ session('success') }}</div>
        @endif

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

            <div class="mb-3">
                <label class="form-label">Email</label>
                <input type="email" name="email" class="form-control" placeholder="Masukkan email" required>
            </div>

            <div class="mb-3">
                <label class="form-label">Password</label>
                <div class="input-group">
                    <input type="password" name="password" class="form-control" id="password" placeholder="Masukkan password" required>
                    <button type="button" class="btn btn-outline-secondary" id="toggle-password">
                        <i class="bi bi-eye-slash" id="eye-icon"></i>
                    </button>
                </div>
            </div>

            {{-- <div class="mb-3 text-end">
                <a href="{{ route('password.request') }}" class="forgot-link">Lupa Password?</a>
            </div> --}}

            <button class="btn btn-gradient w-100">Masuk</button>
        </form>

        <p class="text-center mt-3 mb-0">Belum punya akun? <a href="{{ route('register') }}" class="text-decoration-none fw-semibold" style="color: #00bcd4;">Daftar di sini</a></p>
    </div>

    <script>
        document.getElementById('toggle-password').addEventListener('click', function () {
            const passwordInput = document.getElementById('password');
            const eyeIcon = document.getElementById('eye-icon');
            const isPassword = passwordInput.type === 'password';
            passwordInput.type = isPassword ? 'text' : 'password';
            eyeIcon.classList.toggle('bi-eye-slash', !isPassword);
            eyeIcon.classList.toggle('bi-eye', isPassword);
        });
    </script>
</body>
</html>
