{% extends "base.html" %}

{% block title %}Change Password - AISBF{% endblock %}

{% block content %}
<div class="container">
    <h1 data-i18n="password_page.title">Change Password</h1>
    <p data-i18n="password_page.subtitle">Update your account password</p>

    {% if success %}
    <div class="alert alert-success">{{ success }}</div>
    {% endif %}

    {% if error %}
    <div class="alert alert-error">{{ error }}</div>
    {% endif %}

    <div class="card">
        <h2 data-i18n="password_page.section">Password Settings</h2>
        
        <form method="POST" action="{{ url_for(request, '/dashboard/change-password') }}">
            <div class="form-group">
                <label for="current_password" data-i18n="password_page.current">Current Password</label>
                <input type="password" id="current_password" name="current_password" required>
            </div>

            <div class="form-group">
                <label for="new_password" data-i18n="password_page.new">New Password</label>
                <input type="password" id="new_password" name="new_password" required minlength="6">
            </div>

            <div class="form-group">
                <label for="confirm_password" data-i18n="password_page.confirm">Confirm New Password</label>
                <input type="password" id="confirm_password" name="confirm_password" required minlength="6">
            </div>

            <div style="margin-top: 1.5rem;">
                <button type="submit" class="btn btn-primary" data-i18n="password_page.submit">Change Password</button>
            </div>
        </form>
    </div>
</div>

<style>
.card {
    background: var(--bg-panel);
    padding: 2rem;
    border-radius: 8px;
    margin-top: 1.5rem;
}

.card h2 {
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--color-text);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: var(--bg-page);
    color: var(--color-text);
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-link);
}
</style>
{% endblock %}