{# templates/maintenance/index.html.twig #}
<!DOCTYPE html>
<html lang="fr">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Maintenance en cours - AMA EDU</title>
    <style>
        * { box-sizing: border-box; margin: 0; padding: 0; }

        body {
            font-family: 'Segoe UI', sans-serif;
            background: linear-gradient(135deg, #1a3c6e 0%, #0d2040 100%);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
        }

        .card {
            background: rgba(255,255,255,0.08);
            backdrop-filter: blur(12px);
            border: 1px solid rgba(255,255,255,0.15);
            border-radius: 16px;
            padding: 48px 56px;
            text-align: center;
            max-width: 480px;
            width: 90%;
        }

        .icon {
            font-size: 64px;
            margin-bottom: 24px;
            animation: spin 2s linear infinite;
            display: inline-block;
        }

        @keyframes spin {
            from { transform: rotate(0deg); }
            to   { transform: rotate(360deg); }
        }

        h1 {
            font-size: 1.6rem;
            font-weight: 700;
            margin-bottom: 12px;
        }

        p {
            color: rgba(255,255,255,0.75);
            line-height: 1.7;
            margin-bottom: 8px;
        }

        .badge {
            display: inline-block;
            margin-top: 28px;
            padding: 8px 20px;
            background: rgba(255,255,255,0.12);
            border-radius: 99px;
            font-size: .85rem;
            color: rgba(255,255,255,0.6);
        }

        .progress-dots {
            margin-top: 28px;
            display: flex;
            justify-content: center;
            gap: 8px;
        }

        .dot {
            width: 10px; height: 10px;
            border-radius: 50%;
            background: rgba(255,255,255,0.3);
            animation: pulse 1.4s ease-in-out infinite;
        }
        .dot:nth-child(2) { animation-delay: .2s; }
        .dot:nth-child(3) { animation-delay: .4s; }

        @keyframes pulse {
            0%, 80%, 100% { opacity: .3; transform: scale(1);   }
            40%            { opacity: 1;  transform: scale(1.3); }
        }
    </style>
</head>
<body>
    <div class="card">
        <div class="icon">⚙️</div>

        <h1>Synchronisation en cours</h1>
        <p>
            La plateforme AMA EDU est temporairement indisponible
            le temps de synchroniser les données avec le serveur central.
        </p>
        <p>
            Cette opération dure habituellement <strong>moins de 5 minutes</strong>.
        </p>
        <p>
            Merci de patienter et de rafraîchir la page dans quelques instants.
        </p>

        <div class="progress-dots">
            <div class="dot"></div>
            <div class="dot"></div>
            <div class="dot"></div>
        </div>

        {% if since %}
        <div class="badge">Démarrée le {{ since }}</div>
        {% endif %}
    </div>

    <script>
        // Rafraîchissement automatique toutes les 15 secondes
        setTimeout(() => window.location.reload(), 15000);
    </script>
</body>
</html>
