<x-guest-layout>
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">

<style>
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    min-height: 100vh;
    background: #fff8f0;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed; top: -120px; right: -120px;
    width: 480px; height: 480px; border-radius: 50%;
    background: radial-gradient(circle, rgba(245,158,11,0.18) 0%, transparent 70%);
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed; bottom: -100px; left: -100px;
    width: 380px; height: 380px; border-radius: 50%;
    background: radial-gradient(circle, rgba(217,119,6,0.12) 0%, transparent 70%);
    pointer-events: none;
}

.page-wrapper {
    max-width: 480px;
    margin: 0 auto;
    padding: 52px 24px 72px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Brand */
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 44px; }

.brand-icon {
    width: 52px; height: 52px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(245,158,11,0.35);
}

.brand-icon i { font-size: 22px; color: white; }
.brand-text h1 { font-size: 20px; font-weight: 800; color: #1a0e00; line-height: 1; }
.brand-text p  { font-size: 12px; color: #b47c44; font-weight: 500; margin-top: 3px; }

/* Page title */
.page-title { margin-bottom: 40px; }
.page-title h2 { font-size: 30px; font-weight: 800; color: #1a0e00; line-height: 1.2; }
.page-title h2 span { color: #d97706; }
.page-title p { font-size: 14px; color: #7a5a3a; margin-top: 8px; line-height: 1.6; }

/* Section heading */
.section-heading {
    font-size: 11px; font-weight: 800; color: #d97706;
    text-transform: uppercase; letter-spacing: 1.5px;
    margin-bottom: 16px;
    display: flex; align-items: center; gap: 8px;
}
.section-heading::after {
    content: ''; flex: 1; height: 1px;
    background: linear-gradient(to right, #fde68a, transparent);
}

/* Form group */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block; font-size: 12px; font-weight: 700;
    color: #4a2e0e; margin-bottom: 7px;
    text-transform: uppercase; letter-spacing: 0.4px;
}

/* Input */
.input-wrapper { position: relative; }

.input-wrapper i.icon-left {
    position: absolute; left: 15px; top: 50%;
    transform: translateY(-50%);
    color: #c49050; font-size: 14px;
    pointer-events: none; z-index: 1;
}

.input-wrapper input {
    width: 100%;
    padding: 13px 14px 13px 44px;
    border: 1.5px solid #f0dcc8; border-radius: 14px;
    font-size: 14px; font-family: 'Plus Jakarta Sans', sans-serif;
    background: white; color: #2a1600; transition: all 0.2s;
}

.input-wrapper input:focus {
    outline: none; border-color: #f59e0b;
    background: #fffdf9;
    box-shadow: 0 0 0 4px rgba(245,158,11,0.1);
}

.input-wrapper input::placeholder { color: #d4b896; }

/* Password toggle */
.password-toggle {
    position: absolute; right: 14px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none; cursor: pointer;
    color: #c49050; font-size: 14px; padding: 0;
}

/* Error */
.error-message {
    color: #dc2626; font-size: 11px; margin-top: 5px;
    display: flex; align-items: center; gap: 4px;
}

/* Session alert */
.session-alert {
    background: #fef3c7; border: 1.5px solid #fde68a;
    border-radius: 14px; padding: 12px 16px;
    margin-bottom: 24px;
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; font-weight: 500; color: #92400e;
}

/* Remember & Forgot row */
.options-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px;
}

.checkbox-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: #7a5a3a; cursor: pointer; font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: #f59e0b; cursor: pointer;
}

.forgot-link {
    font-size: 12px; font-weight: 700;
    color: #d97706; text-decoration: none;
}
.forgot-link:hover { text-decoration: underline; }

/* Submit */
.btn-submit {
    width: 100%; padding: 15px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none; border-radius: 16px; color: white;
    font-size: 15px; font-weight: 800;
    font-family: 'Plus Jakarta Sans', sans-serif;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
    margin-top: 24px; transition: all 0.25s;
    box-shadow: 0 8px 24px rgba(245,158,11,0.3);
    position: relative; overflow: hidden;
}

.btn-submit::before {
    content: ''; position: absolute; top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.4s;
}

.btn-submit:hover::before { left: 100%; }
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(245,158,11,0.4); }

/* Divider */
.divider {
    display: flex; align-items: center; gap: 12px;
    margin: 28px 0;
}
.divider::before, .divider::after {
    content: ''; flex: 1; height: 1px; background: #f0dcc8;
}
.divider span { font-size: 12px; font-weight: 600; color: #c49050; white-space: nowrap; }

/* Register section */
.register-section { text-align: center; }
.register-section p { font-size: 13px; color: #7a5a3a; margin-bottom: 14px; }

.btn-register-outline {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 32px;
    background: transparent;
    border: 2px solid #f59e0b;
    border-radius: 99px;
    color: #d97706;
    font-size: 13px; font-weight: 700;
    text-decoration: none;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: all 0.2s;
}
.btn-register-outline:hover {
    background: #f59e0b; color: white;
    box-shadow: 0 8px 20px rgba(245,158,11,0.3);
    transform: translateY(-1px);
}

@media (max-width: 480px) {
    .page-wrapper { padding: 32px 18px 52px; justify-content: flex-start; padding-top: 48px; }
    .page-title h2 { font-size: 24px; }
}
</style>

<div class="page-wrapper">

    {{-- Brand --}}
    <div class="brand">
        <div class="brand-icon"><i class="fas fa-couch"></i></div>
        <div class="brand-text">
            <h1>LokaFurniture</h1>
            <p>Furnitur lokal terbaik</p>
        </div>
    </div>

    {{-- Page title --}}
    <div class="page-title">
        <h2>Selamat <span>datang</span> kembali ✦</h2>
        <p>Masuk ke akun Anda dan lanjutkan belanja furnitur impian.</p>
    </div>

    {{-- Session alert --}}
    @if(session('status'))
        <div class="session-alert">
            <i class="fas fa-circle-check" style="color:#d97706;"></i>
            <span>{{ session('status') }}</span>
        </div>
    @endif

    @if(session('success'))
        <div class="session-alert">
            <i class="fas fa-circle-check" style="color:#16a34a;"></i>
            <span style="color:#15803d;">{{ session('success') }}</span>
        </div>
    @endif

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

        <div class="section-heading"><i class="fas fa-lock"></i> Informasi Akun</div>

        {{-- Email --}}
        <div class="form-group">
            <label for="email">Alamat Email</label>
            <div class="input-wrapper">
                <i class="icon-left fas fa-envelope"></i>
                <input type="email" id="email" name="email"
                       value="{{ old('email') }}"
                       placeholder="nama@email.com"
                       required autofocus autocomplete="email">
            </div>
            @error('email')
                <div class="error-message"><i class="fas fa-exclamation-circle"></i> {{ $message }}</div>
            @enderror
        </div>

        {{-- Password --}}
        <div class="form-group">
            <label for="password">Password</label>
            <div class="input-wrapper">
                <i class="icon-left fas fa-lock"></i>
                <input type="password" id="password" name="password"
                       placeholder="Masukkan password"
                       required autocomplete="current-password">
                <button type="button" class="password-toggle" onclick="togglePw()">
                    <i class="fas fa-eye" id="pwIcon"></i>
                </button>
            </div>
            @error('password')
                <div class="error-message"><i class="fas fa-exclamation-circle"></i> {{ $message }}</div>
            @enderror
        </div>

        {{-- Remember & Forgot --}}
        <div class="options-row">
            <label class="checkbox-label">
                <input type="checkbox" name="remember" {{ old('remember') ? 'checked' : '' }}>
                <span>Ingat saya</span>
            </label>
            @if(Route::has('password.request'))
                <a href="{{ route('password.request') }}" class="forgot-link">Lupa password?</a>
            @endif
        </div>

        <button type="submit" class="btn-submit">
            <i class="fas fa-arrow-right-to-bracket"></i> MASUK
        </button>
    </form>

    <div class="divider"><span>belum punya akun?</span></div>

    <div class="register-section">
        <a href="{{ route('register') }}" class="btn-register-outline">
            <i class="fas fa-user-plus"></i> Daftar Sekarang
        </a>
    </div>

</div>

<script>
function togglePw() {
    const inp = document.getElementById('password');
    const ic  = document.getElementById('pwIcon');
    if (inp.type === 'password') {
        inp.type = 'text';
        ic.classList.replace('fa-eye', 'fa-eye-slash');
    } else {
        inp.type = 'password';
        ic.classList.replace('fa-eye-slash', 'fa-eye');
    }
}
</script>
</x-guest-layout>