<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="icon" type="image/png" sizes="32x32" href="{{ asset('images/Logo-02.png') }}?v={{ time() }}">
    <title>Enter Access Code - Sakanta</title>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Work Sans', sans-serif;
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, #064852 0%, #0a6270 100%);
            padding: 20px;
        }

        .container {
            max-width: 500px;
            width: 100%;
            background: white;
            border-radius: 20px;
            padding: 50px 40px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        }

        .logo {
            text-align: center;
            margin-bottom: 30px;
        }

        .logo img {
            height: 80px;
        }

        h1 {
            font-size: 28px;
            font-weight: 600;
            color: #064852;
            margin-bottom: 10px;
            text-align: center;
        }

        p {
            text-align: center;
            color: #666;
            margin-bottom: 30px;
        }

        .form-group {
            margin-bottom: 20px;
        }

        label {
            display: block;
            font-weight: 600;
            color: #064852;
            margin-bottom: 8px;
            font-size: 14px;
        }

        input {
            width: 100%;
            padding: 14px 18px;
            border: 2px solid #e0e0e0;
            border-radius: 10px;
            font-size: 15px;
            font-family: 'Work Sans', sans-serif;
            transition: all 0.3s ease;
        }

        input:focus {
            outline: none;
            border-color: #064852;
            box-shadow: 0 0 0 3px rgba(6, 72, 82, 0.1);
        }

        input:disabled {
            background: #f5f5f5;
            color: #666;
        }

        .btn {
            width: 100%;
            padding: 16px;
            border: none;
            border-radius: 10px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            font-family: 'Work Sans', sans-serif;
        }

        .btn-primary {
            background: #064852;
            color: white;
        }

        .btn-primary:hover {
            background: #053640;
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(6, 72, 82, 0.3);
        }

        .back-link {
            display: block;
            text-align: center;
            margin-top: 20px;
            color: #064852;
            text-decoration: none;
            font-weight: 500;
        }

        .back-link:hover {
            text-decoration: underline;
        }

        .alert {
            padding: 12px 20px;
            border-radius: 10px;
            margin-bottom: 20px;
            font-size: 14px;
        }

        .alert.error {
            background: #fee;
            color: #c00;
            border: 1px solid #fcc;
        }

        .alert.success {
            background: #efe;
            color: #060;
            border: 1px solid #cfc;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="logo">
            <img src="{{ asset('images/Logo-01.png') }}" alt="Sakanta">
        </div>

        <h1>Enter Access Code</h1>
        <p>Please enter your access code to continue</p>

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

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

        <form action="{{ route('auth.verify-access') }}" method="POST">
            @csrf
            
            <div class="form-group">
                <label for="email">Email</label>
                <input type="email" id="email" name="email" value="{{ session('google_user_email') }}" readonly required>
            </div>

            <div class="form-group">
                <label for="access_code">Access Code</label>
                <input type="text" id="access_code" name="access_code" placeholder="Enter your access code (e.g., SKT123456)" required autofocus>
            </div>

            <button type="submit" class="btn btn-primary">Continue</button>
        </form>

        <a href="{{ route('auth.access-choice') }}" class="back-link">← Back to options</a>
    </div>
</body>
</html>
