<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Pendaftaran - E-Recruitment</title>
    <link rel="icon" type="image/png" href="{{ asset('assets/images/logo.png') }}">
    <link rel="stylesheet" href="{{ asset('css/style.css?v=1779407811') }}">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        .auth-container {
            max-width: 900px;
            margin: 40px auto;
            background: #FFFFFF;
            padding: 30px 40px;
        }
        
        .auth-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 40px;
            padding-bottom: 20px;
            border-bottom: 1px solid #eee;
        }
        
        .top-nav {
            display: flex;
            justify-content: flex-end;
            gap: 20px;
            padding: 10px 40px;
            font-size: 0.85rem;
        }
        
        .top-nav a {
            text-decoration: none;
            color: #666;
            display: flex;
            align-items: center;
            gap: 5px;
        }
        
        .btn-login-small {
            background-color: #1976D2;
            color: white !important;
            padding: 5px 15px;
            border-radius: 4px;
            font-weight: 600;
        }
        
        .main-nav {
            display: flex;
            gap: 25px;
        }
        
        .main-nav a {
            text-decoration: none;
            color: var(--primary-green);
            font-weight: 600;
            font-size: 0.95rem;
        }
        
        .main-nav a.active {
            background-color: var(--secondary-green);
            padding: 5px 15px;
            border-radius: 4px;
        }
        
        .auth-card {
            border: 2px solid var(--primary-green);
            border-radius: 4px;
            padding: 30px;
            max-width: 650px;
            margin: 0 auto;
        }
        
        .auth-card h3 {
            font-size: 1.2rem;
            margin-bottom: 10px;
            color: #333;
        }
        
        .auth-card p {
            color: #666;
            font-size: 0.9rem;
            margin-bottom: 25px;
        }
        
        .form-grid-auth {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
        }
        
        .auth-form-group {
            position: relative;
            display: flex;
            flex-direction: column;
        }
        
        .auth-form-group.full-width {
            grid-column: span 2;
        }
        
        .auth-form-group label {
            position: absolute;
            top: -8px;
            left: 10px;
            background-color: #FFFFFF;
            padding: 0 5px;
            font-size: 0.75rem;
            color: #666;
            z-index: 1;
        }
        
        .auth-form-group input {
            width: 100%;
            padding: 14px 12px;
            border: 1px solid #ccc;
            border-radius: 4px;
            font-size: 0.95rem;
        }
        
        .btn-otp {
            background: white;
            border: 1px solid #1976D2;
            color: #1976D2;
            font-weight: 600;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.3s;
        }
        
        .btn-otp:hover {
            background: #f0f7ff;
        }
        
        .btn-submit-auth {
            background-color: #1976D2;
            color: white;
            border: none;
            padding: 12px;
            border-radius: 4px;
            font-weight: 600;
            width: 100%;
            margin-top: 30px;
            cursor: pointer;
            font-size: 1rem;
        }
        
        .footer-auth {
            background-color: var(--primary-green);
            color: white;
            padding: 15px 40px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0.85rem;
            margin-top: 40px;
            border-radius: 8px;
        }
    </style>
</head>
<body style="background-color: #E8F5E9;">

    <div class="top-bar">
        <div class="top-bar-left" style="display: flex; align-items: center; gap: 8px;">
            <div style="width: 20px; height: 20px; background-image: url('{{ asset('assets/images/logo.png') }}'); background-size: cover; border-radius: 2px;"></div>
            PT Brahma Bina Bakti
        </div>
                <div class="top-bar-right">
            <a href="{{ route('panduan') }}"><i class="fas fa-book"></i> Panduan</a>
            @guest
                <a href="{{ route('login') }}" class="btn-logout" style="background-color: #1976D2;"><i class="fas fa-sign-in-alt"></i> Login</a>
            @else
                <span style="color: #fff; margin-right: 15px;"><i class="fas fa-user"></i> {{ Auth::user()->nama_depan }}</span>
                <a href="#" onclick="event.preventDefault(); document.getElementById('logout-form').submit();" class="btn-logout"><i class="fas fa-sign-out-alt"></i> Logout</a>
            @endguest
        </div>
    </div>

    <header class="header">
        <div class="logo-container">
            <div style="width: 45px; height: 45px; background-image: url('{{ asset('assets/images/logo.png') }}'); background-size: cover; border-radius: 4px;"></div>
            <div class="logo-text">
                <h1 style="margin:0; font-size: 1.2rem; font-weight: 700; color: #333;">E-Recruitment PT BBB Sekernan</h1>
                <p style="margin:0; font-size: 0.9rem; color: #666;">Recruitment Online</p>
            </div>
        </div>
                <nav class="nav-links">
            <a href="{{ route('index') }}" class="{{ request()->routeIs('index') ? 'active' : '' }}">Beranda</a>
            <a href="{{ route('pengumuman') }}" class="{{ request()->routeIs('pengumuman') ? 'active' : '' }}">Pengumuman</a>
            @guest
                <a href="{{ route('daftar') }}" class="{{ request()->routeIs('daftar') ? 'active' : '' }}">Daftar</a>
            @endguest
            <a href="{{ route('faq') }}" class="{{ request()->routeIs('faq') ? 'active' : '' }}">FAQ</a>
            @auth
                <a href="#" onclick="event.preventDefault(); document.getElementById('logout-form').submit();" style="color: #d32f2f; font-weight: bold;">Logout</a>
                <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
                    @csrf
                </form>
            @endauth
        </nav>
    </header>

    <div class="auth-container">

        <h2 style="margin-bottom: 20px; font-weight: 600;">Pendaftaran</h2>

        <div class="auth-card">
            <h3>Registrasi Akun Baru</h3>
            <p>Silakan lengkapi data berikut untuk membuat akun rekrutmen.</p>

            @if($errors->any())
            <div style="background: #F8D7DA; color: #721C24; padding: 12px 16px; border-radius: 6px; margin-bottom: 20px; font-size: 0.9rem; border: 1px solid #F5C6CB;">
                <i class="fas fa-exclamation-circle"></i>
                <ul style="margin: 4px 0 0 16px; padding: 0;">
                    @foreach($errors->all() as $error)
                    <li>{{ $error }}</li>
                    @endforeach
                </ul>
            </div>
            @endif

            <form action="{{ route('daftar.post') }}" method="POST">
                @csrf
                <div class="form-grid-auth">
                    <div class="auth-form-group full-width">
                        <label>Email</label>
                        <input type="email" name="email" value="{{ old('email') }}" required>
                    </div>
                    
                    <div class="auth-form-group">
                        <label>Nama Depan</label>
                        <input type="text" name="nama_depan" value="{{ old('nama_depan') }}" required>
                    </div>
                    
                    <div class="auth-form-group">
                        <label>Nama Belakang</label>
                        <input type="text" name="nama_belakang" value="{{ old('nama_belakang') }}" required>
                    </div>

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

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

                <button type="submit" class="btn-submit-auth">DAFTAR SEKARANG</button>
            </form>
            
            <div style="margin-top: 25px; font-size: 0.9rem; color: #666; text-align: center;">
                <p>Sudah memiliki akun? <a href="{{ route('login') }}" style="color: #1976D2; font-weight: 600; text-decoration: none;">Login di sini</a></p>
            </div>
        </div>
        
        <div class="footer-auth">
            <span>Copyright &copy; 2026 PT Brahma Bina Bakti, All Rights Reserved.</span>
            <div style="font-weight: 900; font-style: italic; font-size: 1.2rem;">BBB</div>
        </div>
    </div>

</body>
</html>
