<!doctype html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Reset Password — Synergo SSO</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=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
    <style>
        *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            min-height: 100vh; display: flex; align-items: center; justify-content: center;
            background: #f0f4f8; overflow: hidden; position: relative;
        }
        body::before {
            content: ''; position: fixed; top: -80px; right: -80px;
            width: 280px; height: 280px; background: rgba(59, 130, 246, 0.06);
            border-radius: 50%; z-index: 0;
        }
        body::after {
            content: ''; position: fixed; bottom: -60px; left: -60px;
            width: 220px; height: 220px; background: rgba(59, 130, 246, 0.05);
            border-radius: 50%; z-index: 0;
        }
        .blob-accent { position: fixed; width: 160px; height: 160px; background: rgba(16, 185, 129, 0.05); border-radius: 50%; z-index: 0; }
        .blob-accent-1 { top: 30%; left: -40px; }
        .blob-accent-2 { bottom: 20%; right: 10%; }
        .card {
            position: relative; z-index: 1; background: rgba(255, 255, 255, 0.85);
            backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
            border-radius: 24px; padding: 48px 40px; width: 100%; max-width: 400px;
            box-shadow: 0 4px 6px -1px rgba(0,0,0,0.04), 0 10px 40px -4px rgba(0,0,0,0.08);
            border: 1px solid rgba(255,255,255,0.6); animation: cardSlideUp 0.6s ease-out;
        }
        @keyframes cardSlideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
        .illustration-wrapper { text-align: center; margin-bottom: 24px; }
        .illustration-wrapper img { width: 200px; height: auto; animation: floatIllustration 4s ease-in-out infinite; }
        @keyframes floatIllustration { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
        .card h1 { font-size: 26px; font-weight: 700; color: #111827; text-align: center; margin-bottom: 8px; }
        .card .subtitle { font-size: 14px; color: #6b7280; text-align: center; margin-bottom: 32px; line-height: 1.5; }
        .alert-error { background: #fef2f2; border: 1px solid #fecaca; border-radius: 12px; padding: 12px 16px; margin-bottom: 20px; animation: shake 0.4s ease-in-out; }
        @keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
        .alert-error ul { list-style: none; padding: 0; margin: 0; }
        .alert-error li { font-size: 13px; color: #dc2626; display: flex; align-items: center; gap: 6px; }
        .alert-error li::before { content: ''; width: 6px; height: 6px; background: #dc2626; border-radius: 50%; flex-shrink: 0; }
        .input-group { position: relative; margin-bottom: 16px; }
        .input-group .input-icon {
            position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
            color: #9ca3af; pointer-events: none; transition: color 0.2s;
        }
        .input-group input {
            width: 100%; padding: 14px 48px 14px 48px; border: 1.5px solid #e5e7eb;
            border-radius: 12px; font-size: 15px; font-family: 'Inter', sans-serif;
            color: #374151; background: #fff; transition: all 0.25s ease; outline: none;
        }
        .input-group input::placeholder { color: #9ca3af; }
        .input-group input:focus { border-color: #3b82f6; box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1); }
        .input-group input:focus ~ .input-icon { color: #3b82f6; }
        .password-toggle {
            position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
            background: none; border: none; cursor: pointer; color: #9ca3af; padding: 4px; transition: color 0.2s;
        }
        .password-toggle:hover { color: #6b7280; }
        .btn-submit {
            width: 100%; padding: 14px 24px; background: #2563eb; color: #fff;
            border: none; border-radius: 12px; font-size: 16px; font-weight: 600;
            font-family: 'Inter', sans-serif; cursor: pointer; transition: all 0.3s ease; margin-top: 8px;
        }
        .btn-submit:hover { background: #1d4ed8; transform: translateY(-1px); box-shadow: 0 8px 24px -4px rgba(37, 99, 235, 0.4); }
        .btn-submit:active { transform: translateY(0); }
        .card-footer { text-align: center; margin-top: 28px; font-size: 14px; color: #6b7280; }
        .card-footer a { color: #3b82f6; text-decoration: none; font-weight: 500; }
        @media (max-width: 480px) {
            .card { margin: 16px; padding: 36px 24px; border-radius: 20px; }
            .illustration-wrapper img { width: 160px; }
        }
    </style>
</head>

<body>
    <div class="blob-accent blob-accent-1"></div>
    <div class="blob-accent blob-accent-2"></div>

    <div class="card">
        <div class="illustration-wrapper">
            <img src="{{ asset('images/forgot-password-illustration.png') }}" alt="Reset Password Illustration">
        </div>

        <h1>Reset Password</h1>
        <p class="subtitle">Create a new password for your account</p>

        @if ($errors->any())
            <div class="alert-error">
                <ul>
                    @foreach ($errors->all() as $error)
                        <li>{{ $error }}</li>
                    @endforeach
                </ul>
            </div>
        @endif

        <form method="POST" action="{{ route('password.reset.submit') }}">
            @csrf
            <input type="hidden" name="email" value="{{ $email ?? '' }}">
            <input type="hidden" name="token" value="{{ $token ?? '' }}">

            <!-- New Password -->
            <div class="input-group">
                <input type="password" id="password" name="password" placeholder="New password" required
                    autocomplete="new-password" minlength="8">
                <svg class="input-icon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
                    <rect x="3" y="11" width="18" height="11" rx="2" ry="2"/>
                    <path d="M7 11V7a5 5 0 0 1 10 0v4"/>
                </svg>
                <button type="button" class="password-toggle" onclick="togglePassword('password', 'eye1')">
                    <svg id="eye1" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
                        <path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/>
                    </svg>
                </button>
            </div>

            <!-- Confirm Password -->
            <div class="input-group">
                <input type="password" id="password_confirmation" name="password_confirmation"
                    placeholder="Confirm new password" required autocomplete="new-password" minlength="8">
                <svg class="input-icon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
                    <rect x="3" y="11" width="18" height="11" rx="2" ry="2"/>
                    <path d="M7 11V7a5 5 0 0 1 10 0v4"/>
                </svg>
                <button type="button" class="password-toggle" onclick="togglePassword('password_confirmation', 'eye2')">
                    <svg id="eye2" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
                        <path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/>
                    </svg>
                </button>
            </div>

            <button type="submit" class="btn-submit">Reset Password</button>
        </form>

        <div class="card-footer">
            <a href="{{ route('login') }}">← Back to Sign In</a>
        </div>
    </div>

    <script>
        function togglePassword(inputId, iconId) {
            const input = document.getElementById(inputId);
            const icon = document.getElementById(iconId);
            if (input.type === 'password') {
                input.type = 'text';
                icon.innerHTML = '<path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"/><line x1="1" y1="1" x2="23" y2="23"/>';
            } else {
                input.type = 'password';
                icon.innerHTML = '<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/>';
            }
        }
    </script>
</body>

</html>
