{{template "base" .}}

{{define "title"}}Willkommen{{end}}

{{define "body"}}
<div class="hero">
    <div class="hero-content">
        <div class="hero-label">Digitale Demokratie für Österreich</div>
        <h1 class="hero-title">Gestalten Sie die<br><span class="accent">Zukunft Österreichs</span></h1>
        <p class="hero-text">
            Beteiligen Sie sich an der demokratischen Entscheidungsfindung —
            sicher, transparent und vollständig digital.
        </p>
    </div>
</div>

<div class="auth-section">
    <div class="auth-card">
        <h2 class="auth-title">Anmelden</h2>
        <p class="auth-subtitle">Melden Sie sich an, um an Abstimmungen teilzunehmen.</p>

        {{if .FormErrors}}
        <div class="alert alert--error">
            {{range .FormErrors}}<p>{{.}}</p>{{end}}
        </div>
        {{end}}

        <form method="POST" action="/login">
            <div class="form-group">
                <label class="form-label" for="email">E-Mail-Adresse</label>
                <input class="form-input" type="email" id="email" name="email"
                       placeholder="ihre@email.at" required autocomplete="email">
            </div>
            <div class="form-group">
                <label class="form-label" for="password">Passwort</label>
                <input class="form-input" type="password" id="password" name="password"
                       placeholder="••••••••" required autocomplete="current-password">
            </div>
            <button class="btn btn--primary btn--full" type="submit">Anmelden</button>
        </form>

        <p class="auth-divider">Noch kein Konto? <a href="/register" class="link">Registrieren</a></p>

        {{if .IsDevelopment}}
        <form method="POST" action="/dev-login" style="margin-top:12px;">
            <button class="btn btn--full" type="submit"
                    style="background:none; border:1px solid orange; color:orange;">
                Dev: Neues Testkonto erstellen &amp; anmelden
            </button>
        </form>
        {{end}}
    </div>
</div>
{{end}}
