<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <title>Login - Sistem Hama Padi</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap" rel="stylesheet">
    <style>

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

        body {
            font-family: 'Poppins', sans-serif;
            min-height: 100vh;
            background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 40%, #66bb6a 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }

        /* ===== CARD ===== */
        .auth-card {
            background: white;
            border-radius: 20px;
            padding: 40px;
            width: 100%;
            max-width: 420px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.2);
        }

        /* ===== HEADER ===== */
        .auth-header {
            text-align: center;
            margin-bottom: 30px;
        }

        .auth-header .icon {
            font-size: 48px;
            display: block;
            margin-bottom: 10px;
        }

        .auth-header h2 {
            font-size: 22px;
            font-weight: 700;
            color: #1b5e20;
            margin-bottom: 4px;
        }

        .auth-header p {
            font-size: 13px;
            color: #6b7280;
        }

        /* ===== ALERT ===== */
        .alert {
            padding: 12px 14px;
            border-radius: 10px;
            font-size: 13px;
            margin-bottom: 20px;
        }

        .alert-danger {
            background: #fff0f0;
            color: #c62828;
            border: 1px solid #ffcdd2;
        }

        .alert ul {
            margin: 0;
            padding-left: 18px;
        }

        /* ===== FORM ===== */
        .form-group {
            margin-bottom: 18px;
        }

        .form-group label {
            display: block;
            font-size: 13px;
            font-weight: 500;
            color: #374151;
            margin-bottom: 6px;
        }

        .form-group input {
            width: 100%;
            padding: 11px 14px;
            border: 1.5px solid #e5e7eb;
            border-radius: 10px;
            font-size: 14px;
            font-family: 'Poppins', sans-serif;
            color: #111;
            transition: border-color 0.25s, box-shadow 0.25s;
            background: #fafafa;
        }

        .form-group input:focus {
            outline: none;
            border-color: #2e7d32;
            box-shadow: 0 0 0 3px rgba(46,125,50,0.12);
            background: white;
        }

        /* ===== BUTTON ===== */
        .btn-submit {
            width: 100%;
            padding: 13px;
            background: linear-gradient(135deg, #2e7d32, #66bb6a);
            color: white;
            border: none;
            border-radius: 10px;
            font-size: 15px;
            font-weight: 600;
            font-family: 'Poppins', sans-serif;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
            box-shadow: 0 4px 15px rgba(46,125,50,0.35);
            margin-top: 4px;
        }

        .btn-submit:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(46,125,50,0.4);
        }

        .btn-submit:active {
            transform: translateY(0);
        }

        /* ===== LINKS ===== */
        .auth-links {
            text-align: center;
            margin-top: 18px;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .auth-links a {
            font-size: 13px;
            color: #2e7d32;
            text-decoration: none;
            transition: color 0.2s;
        }

        .auth-links a:hover {
            color: #1b5e20;
            text-decoration: underline;
        }

        /* ===== DIVIDER ===== */
        .divider {
            border: none;
            border-top: 1px solid #f0f0f0;
            margin: 16px 0 0;
        }

        /* ===== RESPONSIVE ===== */
        @media (max-width: 480px) {
            body {
                padding: 16px;
                align-items: flex-start;
                padding-top: 40px;
            }

            .auth-card {
                padding: 28px 22px;
                border-radius: 16px;
            }

            .auth-header .icon {
                font-size: 40px;
            }

            .auth-header h2 {
                font-size: 20px;
            }
        }

    </style>
</head>

<body>

<div class="auth-card">

    <div class="auth-header">
        <span class="icon">🌾</span>
        <h2>Sistem Hama Padi</h2>
        <p>Silakan login untuk melanjutkan</p>
    </div>

    @if(session('error'))
        <div class="alert alert-danger">
            {{ session('error') }}
        </div>
    @endif

    <form method="POST" action="/login">
        @csrf

        <div class="form-group">
            <label for="email">Email</label>
            <input
                type="email"
                id="email"
                name="email"
                placeholder="contoh@email.com"
                value="{{ old('email') }}"
                required
                autocomplete="email"
            >
        </div>

        <div class="form-group">
            <label for="password">Password</label>
            <input
                type="password"
                id="password"
                name="password"
                placeholder="Masukkan password"
                required
                autocomplete="current-password"
            >
        </div>

        <button type="submit" class="btn-submit">Login</button>

    </form>

    <div class="auth-links">
        <a href="/forgot-password">Lupa password?</a>
        <hr class="divider">
        <a href="/register">Belum punya akun? <strong>Daftar sekarang</strong></a>
    </div>

</div>

</body>
</html>