<style>
@import url('https://fonts.bunny.net/css?family=figtree:400,500,600,700&display=swap');
:root {
    --accent: #c04849;
    --accent-dark: #a23a3b;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
}
html, body { margin: 0 !important; padding: 0 !important; background: #0f172a !important; min-height: 100%; font-family: 'Figtree', ui-sans-serif, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
.auth-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, #334155 100%);
    position: relative;
    overflow: hidden;
}
.auth-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(192,72,73,0.15) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(13,148,136,0.1) 0%, transparent 50%);
    animation: authPulse 8s ease-in-out infinite alternate;
}
@keyframes authPulse {
    0% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1.1) rotate(3deg); }
}
.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 44px 36px 36px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.1) inset;
    animation: cardSlideUp 0.5s ease-out;
}
@keyframes cardSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.auth-card .brand-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--accent) 0%, #e05252 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(192,72,73,0.35);
}
.auth-card .brand-icon svg { color: #fff; }
.auth-card h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--gray-900);
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}
.auth-card .subtitle {
    text-align: center;
    color: var(--gray-500);
    font-size: 14px;
    margin-bottom: 30px;
}
.auth-card label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}
.auth-card .input-group {
    position: relative;
    margin-bottom: 20px;
}
.auth-card .input-group .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
    transition: color .2s;
}
.auth-card .input-group input {
    width: 100%;
    padding: 12px 14px 12px 44px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    color: var(--gray-800);
    background: var(--gray-50);
    transition: all .2s;
    outline: none;
}
.auth-card .input-group input::placeholder { color: var(--gray-400); }
.auth-card .input-group input:focus {
    border-color: var(--accent);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(192,72,73,0.1);
}
.auth-card .input-group input:focus + .input-icon,
.auth-card .input-group input:focus ~ .input-icon { color: var(--accent); }
.auth-card .input-group .toggle-pw {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    padding: 4px;
    border-radius: 6px;
    transition: all .2s;
}
.auth-card .input-group .toggle-pw:hover { color: var(--gray-600); background: var(--gray-100); }
.auth-card .input-error {
    color: #dc2626;
    font-size: 12px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.auth-card .options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.auth-card .options-row label {
    margin-bottom: 0;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--gray-600);
}
.auth-card .options-row label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}
.auth-card .options-row a {
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
    transition: color .2s;
}
.auth-card .options-row a:hover { color: var(--accent-dark); }
.auth-card .btn-submit {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent) 0%, #e05252 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 4px 16px rgba(192,72,73,0.35);
    position: relative;
    overflow: hidden;
}
.auth-card .btn-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 100%);
    opacity: 0;
    transition: opacity .2s;
}
.auth-card .btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(192,72,73,0.4);
}
.auth-card .btn-submit:hover::before { opacity: 1; }
.auth-card .btn-submit:active { transform: translateY(0); }
.auth-card .btn-submit-secondary {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    background: var(--white);
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all .2s;
    margin-top: 12px;
}
.auth-card .btn-submit-secondary:hover {
    border-color: var(--gray-300);
    background: var(--gray-50);
    color: var(--gray-800);
}
.auth-card .divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    gap: 12px;
}
.auth-card .divider::before,
.auth-card .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}
.auth-card .divider span {
    font-size: 12px;
    color: var(--gray-400);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.auth-card .links {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--gray-500);
}
.auth-card .links a {
    color: var(--accent);
    font-weight: 700;
    transition: color .2s;
}
.auth-card .links a:hover { color: var(--accent-dark); }
.auth-card .alert {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.auth-card .alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.auth-card .alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
</style>
<div style="position:fixed;top:0;left:0;right:0;z-index:10;padding:16px 24px;">
    <a href="{{ url('/' . request()->segment(1)) }}" style="display:inline-flex;align-items:center;gap:8px;font-size:14px;font-weight:500;color:rgba(255,255,255,0.8);text-decoration:none;transition:color .2s;padding:8px 16px;border-radius:10px;background:rgba(255,255,255,0.1);backdrop-filter:blur(10px);border:1px solid rgba(255,255,255,0.1);">
        <svg width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"/></svg>
        Back to Home
    </a>
</div>
<div class="auth-bg">
    <div class="auth-card">
        <div class="brand-icon">
            <svg width="28" height="28" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"/></svg>
        </div>
        <h2>Reset Password</h2>
        <p class="subtitle">Enter your new password below</p>

        @if($errors->any())
            <div class="alert alert-error">
                <svg width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/></svg>
                @foreach($errors->all() as $error){{ $error }}@endforeach
            </div>
        @endif

        @if(session('status'))
            <div class="alert alert-success">
                <svg width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/></svg>
                {{ session('status') }}
            </div>
        @endif

        <form method="POST" action="{{ url('/user/reset-password') }}">
            @csrf
            <input type="hidden" name="token" value="{{ request()->query('token', '') }}">
            <input type="hidden" name="site_slug" value="{{ request()->segment(1) }}">

            <label for="email">Email Address</label>
            <div class="input-group">
                <input type="email" name="email" id="email" value="{{ old('email', request()->query('email', '')) }}" autofocus readonly>
                <svg class="input-icon" width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"/></svg>
            </div>
            @error('email')<p class="input-error">{{ $message }}</p>@enderror

            <label for="password">New Password</label>
            <div class="input-group">
                <input type="password" name="password" id="password" placeholder="Min 8 characters">
                <svg class="input-icon" width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"/></svg>
                <button type="button" class="toggle-pw" onclick="togglePw('password',this)">
                    <svg width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"/></svg>
                </button>
            </div>
            @error('password')<p class="input-error">{{ $message }}</p>@enderror

            <label for="password_confirmation">Confirm Password</label>
            <div class="input-group">
                <input type="password" name="password_confirmation" id="password_confirmation" placeholder="Repeat your password">
                <svg class="input-icon" width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"/></svg>
                <button type="button" class="toggle-pw" onclick="togglePw('password_confirmation',this)">
                    <svg width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"/></svg>
                </button>
            </div>

            <button type="submit" class="btn-submit" style="margin-top:4px;">Reset Password</button>
        </form>
    </div>
</div>

<script>
function togglePw(id, btn) {
    const inp = document.getElementById(id);
    const isPw = inp.type === 'password';
    inp.type = isPw ? 'text' : 'password';
    btn.innerHTML = isPw
        ? '<svg width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"/></svg>'
        : '<svg width="18" height="18" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"/></svg>';
}
</script>