<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Masuk - WELPER ID</title>
<!-- Mengambil Font Modern dari Google Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap" rel="stylesheet">

<style>
    /* RESET & DASAR */
    * { box-sizing: border-box; margin: 0; padding: 0; }
    body {
        font-family: 'Plus Jakarta Sans', sans-serif;
        background: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 100%);
        min-height: 100vh;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 20px;
        color: #334155;
    }

    /* KARTU LOGIN */
    .card {
        background: #ffffff;
        width: 100%;
        max-width: 420px;
        border-radius: 24px;
        padding: 40px 32px;
        box-shadow: 0 20px 40px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.05);
    }
    .logo {
        font-size: 26px;
        font-weight: 700;
        text-align: center;
        color: #0f172a;
        margin-bottom: 8px;
        letter-spacing: -0.5px;
    }
    .subtitle {
        text-align: center;
        color: #64748b;
        font-size: 14px;
        margin-bottom: 32px;
    }

    /* TAB NAVIGASI */
    .tabs {
        display: flex;
        background: #f1f5f9;
        border-radius: 12px;
        padding: 5px;
        margin-bottom: 24px;
    }
    .tab {
        flex: 1;
        padding: 10px;
        border: none;
        background: transparent;
        font-family: inherit;
        font-weight: 600;
        font-size: 14px;
        color: #64748b;
        cursor: pointer;
        border-radius: 8px;
        transition: all 0.3s ease;
    }
    .tab.active {
        background: #ffffff;
        color: #0f172a;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    /* KONTEN FORM (Dengan Animasi Transisi) */
    .form-content {
        display: none;
        animation: fadeIn 0.4s ease;
    }
    .form-content.active {
        display: block;
    }
    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    /* INPUT & LABEL */
    .form-group {
        margin-bottom: 16px;
    }
    .form-group label {
        display: block;
        font-size: 13px;
        font-weight: 600;
        margin-bottom: 8px;
        color: #475569;
    }
    .form-group input {
        width: 100%;
        padding: 14px 16px;
        border: 1.5px solid #e2e8f0;
        border-radius: 12px;
        font-family: inherit;
        font-size: 14px;
        transition: all 0.2s;
        background: #ffffff;
        color: #0f172a;
    }
    .form-group input:disabled {
        background: #f8fafc;
        color: #94a3b8;
        cursor: not-allowed;
    }
    .form-group input:focus:not(:disabled) {
        outline: none;
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
    }

    /* TOMBOL PRIMARY */
    .btn-primary {
        width: 100%;
        padding: 14px;
        background: #2563eb;
        color: white;
        border: none;
        border-radius: 12px;
        font-family: inherit;
        font-weight: 600;
        font-size: 15px;
        cursor: pointer;
        transition: all 0.2s;
        margin-top: 8px;
    }
    .btn-primary:disabled {
        background: #bfdbfe;
        cursor: not-allowed;
        color: #ffffff;
    }
    .btn-primary:not(:disabled):hover {
        background: #1d4ed8;
        box-shadow: 0 4px 12px rgba(29, 78, 216, 0.2);
    }

    /* PEMISAH (Atau) */
    .divider {
        display: flex;
        align-items: center;
        text-align: center;
        margin: 28px 0;
        color: #94a3b8;
        font-size: 13px;
        font-weight: 500;
    }
    .divider::before, .divider::after {
        content: '';
        flex: 1;
        border-bottom: 1px solid #e2e8f0;
    }
    .divider::before { margin-right: 12px; }
    .divider::after { margin-left: 12px; }
    
    /* TOMBOL GOOGLE */
    .btn-google {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        width: 100%;
        padding: 14px;
        background: #ffffff;
        border: 1.5px solid #e2e8f0;
        border-radius: 12px;
        color: #334155;
        text-decoration: none;
        font-weight: 600;
        font-size: 15px;
        transition: all 0.2s;
    }
    .btn-google svg {
        width: 22px;
        height: 22px;
    }
    .btn-google:hover {
        background: #f8fafc;
        border-color: #cbd5e1;
        box-shadow: 0 2px 6px rgba(0,0,0,0.02);
    }

    /* NOTIFIKASI / ALERT */
    .alert {
        padding: 14px 16px;
        border-radius: 12px;
        margin-bottom: 24px;
        font-size: 14px;
        font-weight: 500;
        display: none;
    }
    .alert.show {
        display: block;
        animation: fadeIn 0.4s ease;
    }
    .alert.success {
        background: #ecfdf5;
        color: #065f46;
        border: 1px solid #a7f3d0;
    }
    .alert.error {
        background: #fef2f2;
        color: #991b1b;
        border: 1px solid #fecaca;
    }

    /* INFO COMING SOON */
    .coming-soon {
        background: #fffbeb;
        color: #92400e;
        padding: 14px;
        border-radius: 10px;
        font-size: 13px;
        font-weight: 500;
        text-align: center;
        margin-bottom: 20px;
        border: 1px dashed #fcd34d;
    }

    /* FOOTER KECIL */
    .note {
        text-align: center;
        margin-top: 28px;
        font-size: 13px;
        color: #64748b;
        line-height: 1.6;
    }
    .note a {
        color: #2563eb;
        text-decoration: none;
        font-weight: 600;
        transition: color 0.2s;
    }
    .note a:hover {
        color: #1e40af;
        text-decoration: underline;
    }
</style>
</head>
<body>

<div class="card">
    <div class="logo">WELPER ID</div>
    <div class="subtitle">Masuk atau daftar untuk melanjutkan</div>

    <!-- 2. INI KODE PHP UNTUK MUNCULIN PESAN ERROR/SUKSES -->
    
        <!-- AKHIR KODE PHP PESAN -->
    
    <!-- TABS -->
    <div class="tabs">
        <button class="tab active" onclick="switchTab('login', event)">Masuk</button>
        <button class="tab" onclick="switchTab('register', event)">Daftar</button>
    </div>

    <!-- FORM LOGIN -->
    <div id="form-login" class="form-content active">
        <div class="coming-soon">🚧 Fitur email segera hadir. Gunakan Google untuk saat ini.</div>
        <div class="form-group">
            <label>Alamat Email</label>
            <input type="email" placeholder="nama@email.com" disabled>
        </div>
        <div class="form-group">
            <label>Kata Sandi</label>
            <input type="password" placeholder="••••••••" disabled>
        </div>
        <button class="btn-primary" disabled>Masuk</button>
    </div>

    <!-- FORM REGISTER -->
    <div id="form-register" class="form-content">
        <div class="coming-soon">🚧 Fitur daftar manual segera hadir. Daftar via Google gratis!</div>
        <div class="form-group">
            <label>Nama Lengkap</label>
            <input type="text" placeholder="Nama sesuai KTP" disabled>
        </div>
        <div class="form-group">
            <label>Alamat Email</label>
            <input type="email" placeholder="nama@email.com" disabled>
        </div>
        <div class="form-group">
            <label>Buat Kata Sandi</label>
            <input type="password" placeholder="Minimal 8 karakter" disabled>
        </div>
        <button class="btn-primary" disabled>Buat Akun</button>
    </div>

    <div class="divider">atau</div>

    <!-- TOMBOL LOGIN GOOGLE -->
    <a href="/api/google-login.php" class="btn-google">
        <svg viewBox="0 0 48 48">
            <path fill="#FFC107" d="M43.6 20.5H42V20H24v8h11.3C33.7 32.9 29.3 36 24 36c-6.6 0-12-5.4-12-12s5.4-12 12-12c3.1 0 5.9 1.2 8 3.1l5.7-5.7C34.1 6.1 29.3 4 24 4 12.9 4 4 12.9 4 24s8.9 20 20 20 20-8.9 20-20c0-1.3-.1-2.3-.4-3.5z"/>
            <path fill="#FF3D00" d="M6.3 14.7l6.6 4.8C14.7 15.1 19 12 24 12c3.1 0 5.9 1.2 8 3.1l5.7-5.7C34.1 6.1 29.3 4 24 4 16.3 4 9.7 8.3 6.3 14.7z"/>
            <path fill="#4CAF50" d="M24 44c5.2 0 9.9-2 13.4-5.2l-6.2-5.2C29.2 35.1 26.7 36 24 36c-5.2 0-9.6-3.1-11.3-8l-6.5 5C9.5 39.6 16.2 44 24 44z"/>
            <path fill="#1976D2" d="M43.6 20.5H42V20H24v8h11.3c-.8 2.3-2.3 4.3-4.1 5.6l6.2 5.2C36.9 39.2 44 34 44 24c0-1.3-.1-2.3-.4-3.5z"/>
        </svg>
        Lanjutkan dengan Google
    </a>

    <!-- CATATAN FOOTER -->
    <div class="note">
        Dengan melanjutkan, kamu setuju dengan<br>
        <a href="#">Syarat & Ketentuan</a> serta <a href="#">Kebijakan Privasi</a> kami.
    </div>
</div>

<script>
// Fungsi untuk memindahkan tab dengan efek smooth
function switchTab(tab, e) {
    document.querySelectorAll('.tab').forEach(t => t.classList.remove('active'));
    document.querySelectorAll('.form-content').forEach(f => f.classList.remove('active'));
    
    e.target.classList.add('active');
    document.getElementById('form-' + tab).classList.add('active');
}

// Membersihkan URL dari pesan error/success saat di-refresh agar lebih bersih
if (window.location.search) {
    window.history.replaceState({}, '', '/'); 
}
</script>

</body>
</html>