{% extends "base_security.html.twig" %}
{% block fos_user_title %}
<h4 class="auth-header">{{ 'menu.init_reset_password' | trans }}</h4>
{% endblock fos_user_title %}
{% block fos_user_content %}
<div class="container">
<div class="comoros-flag-animation">
<div class="flag-wave">
<svg viewBox="0 0 600 400" xmlns="http://www.w3.org/2000/svg">
<!-- Drapeau des Comores animé -->
<defs>
<linearGradient id="waveGrad" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" style="stop-color:#3b6e2c;stop-opacity:1" />
<stop offset="50%" style="stop-color:#ffffff;stop-opacity:1" />
<stop offset="100%" style="stop-color:#cf0921;stop-opacity:1" />
</linearGradient>
<filter id="shadow">
<feDropShadow dx="2" dy="4" stdDeviation="3" flood-opacity="0.3"/>
</filter>
</defs>
<!-- Bande jaune (lune et étoiles) -->
<rect x="0" y="0" width="600" height="400" fill="#f3c300"/>
<!-- Bandes horizontales -->
<rect x="80" y="0" width="520" height="80" fill="#3b6e2c"/>
<rect x="80" y="80" width="520" height="80" fill="#ffffff"/>
<rect x="80" y="160" width="520" height="80" fill="#cf0921"/>
<rect x="80" y="240" width="520" height="160" fill="#f3c300"/>
<!-- Triangle blanc -->
<polygon points="0,0 120,0 120,400 0,400" fill="#ffffff"/>
<!-- Triangle vert -->
<polygon points="0,0 100,0 100,400 0,400" fill="#3b6e2c"/>
<!-- Croissant et étoiles -->
<g class="moon-stars" filter="url(#shadow)">
<!-- Croissant de lune -->
<circle cx="55" cy="200" r="35" fill="#f3c300"/>
<circle cx="70" cy="195" r="28" fill="#3b6e2c"/>
<!-- 4 étoiles -->
<polygon points="45,120 48,130 58,130 50,136 53,146 45,140 37,146 40,136 32,130 42,130" fill="#ffffff" class="star1"/>
<polygon points="85,280 88,290 98,290 90,296 93,306 85,300 77,306 80,296 72,290 82,290" fill="#ffffff" class="star2"/>
<polygon points="25,300 28,310 38,310 30,316 33,326 25,320 17,326 20,316 12,310 22,310" fill="#ffffff" class="star3"/>
<polygon points="95,140 98,150 108,150 100,156 103,166 95,160 87,166 90,156 82,150 92,150" fill="#ffffff" class="star4"/>
</g>
</svg>
</div>
</div>
<div class="form-text text-md-center">
<em>
{{ 'menu.information_for_reset_password_with_tag' | trans({'%tag_br%': '<br/>'}) | raw }}
</em>
</div>
<form action="{{ path('register_ask_new_password') }}" method="POST" class="fos_user_resetting_request">
{{ form_widget(form._token) }}
<div class="form-group">
<label for="">{{ 'menu.login_phone' | trans }}*</label>
{{ form_widget(form.phone) }}
<div class="pre-icon os-icon os-icon-user-male-circle"></div>
</div>
<div class="form-group">
<label for="">{{ 'menu.optional_email' | trans }}</label>
{{ form_widget(form.email) }}
<div class="pre-icon os-icon os-icon-email-forward"></div>
</div>
<div class="form-group">
<label for="">{{ 'menu.verification_code' | trans }}</label>
{{ form_widget(form.validCode, { 'value': '' }) }}
<div class="pre-icon os-icon os-icon-fingerprint"></div>
</div>
<div class="multi_submit">
<input id="submit_change_password" class="btn btn-primary" type="submit" value="Initialiser" />
<a class="btn btn-primary" href="{{ path('logout') }}">{{ 'menu.cancel' | trans }}</a>
</div>
</form>
</div>
{% endblock fos_user_content %}
{% block stylesheets %}
{{ parent() }}
<style>
/* ============================================
CADRE RECTANGLE - LARGEUR RÉDUITE
============================================ */
/* Cadre rectangle plus petit */
.auth-box-w {
max-width: 380px !important;
width: 100% !important;
margin: 30px auto !important;
padding: 25px 28px 30px 28px !important;
border-radius: 16px !important;
background: white !important;
box-shadow: 0 5px 20px rgba(0,0,0,0.1) !important;
border: 1px solid #ddd !important;
position: relative !important;
z-index: 2 !important;
}
/* Centrage de la carte */
.auth-wrapper {
display: flex !important;
justify-content: center !important;
align-items: center !important;
min-height: 100vh !important;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
position: relative !important;
overflow: hidden !important;
}
/* Animation du drapeau comorien en arrière-plan */
.comoros-flag-animation {
position: fixed !important;
top: 0 !important;
left: 0 !important;
width: 100% !important;
height: 100% !important;
z-index: 1 !important;
pointer-events: none !important;
overflow: hidden !important;
}
.flag-wave {
position: absolute !important;
top: 50% !important;
left: 50% !important;
transform: translate(-50%, -50%) scale(0.8) !important;
width: 600px !important;
height: 400px !important;
opacity: 0.15 !important;
animation: floatFlag 8s ease-in-out infinite, rotateFlag 20s linear infinite !important;
}
.flag-wave svg {
width: 100% !important;
height: 100% !important;
animation: waveFlag 3s ease-in-out infinite !important;
}
/* Animation des étoiles */
.star1 {
animation: starGlow 2s ease-in-out infinite;
transform-origin: 45px 140px;
}
.star2 {
animation: starGlow 2.5s ease-in-out infinite 0.5s;
transform-origin: 85px 300px;
}
.star3 {
animation: starGlow 3s ease-in-out infinite 1s;
transform-origin: 25px 320px;
}
.star4 {
animation: starGlow 2.2s ease-in-out infinite 1.5s;
transform-origin: 95px 160px;
}
.moon-stars {
animation: pulse 3s ease-in-out infinite;
}
@keyframes floatFlag {
0%, 100% {
transform: translate(-50%, -50%) scale(0.8) translateY(0px);
}
50% {
transform: translate(-50%, -50%) scale(0.85) translateY(-20px);
}
}
@keyframes rotateFlag {
0% {
transform: translate(-50%, -50%) scale(0.8) rotate(0deg);
}
100% {
transform: translate(-50%, -50%) scale(0.8) rotate(360deg);
}
}
@keyframes waveFlag {
0%, 100% {
transform: skewX(0deg) scaleX(1);
}
50% {
transform: skewX(5deg) scaleX(1.05);
}
}
@keyframes starGlow {
0%, 100% {
opacity: 0.7;
transform: scale(1);
}
50% {
opacity: 1;
transform: scale(1.2);
}
}
@keyframes pulse {
0%, 100% {
transform: scale(1);
}
50% {
transform: scale(1.05);
}
}
/* Logos en haut */
.logo-w {
padding: 10px 0 20px 0 !important;
margin-bottom: 10px !important;
gap: 15px !important;
display: flex !important;
justify-content: center !important;
position: relative !important;
z-index: 2 !important;
}
.logo-w img {
max-width: 85px !important;
height: auto !important;
}
/* Bouton langue */
#buttonSelectLang {
height: 32px !important;
margin: 0 !important;
padding: 4px 10px !important;
font-size: 11px !important;
}
/* Titre */
.auth-header {
font-size: 22px !important;
font-weight: 600 !important;
text-align: center !important;
margin-bottom: 20px !important;
padding-bottom: 10px !important;
border-bottom: 2px solid #e0e0e0 !important;
color: #333 !important;
}
/* Texte d'information */
.form-text {
background: #f9f9f9 !important;
padding: 10px 12px !important;
border-radius: 8px !important;
margin-bottom: 20px !important;
font-size: 12px !important;
color: #666 !important;
text-align: center !important;
border-left: 3px solid #007bff !important;
}
/* Champs de formulaire */
.form-group {
margin-bottom: 18px !important;
}
.form-group label {
font-size: 12px !important;
font-weight: 500 !important;
color: #333 !important;
margin-bottom: 5px !important;
display: block !important;
}
.form-control {
width: 100% !important;
padding: 8px 10px !important;
border: 1px solid #ccc !important;
border-radius: 6px !important;
font-size: 13px !important;
background: #fff !important;
}
.form-control:focus {
border-color: #007bff !important;
outline: none !important;
box-shadow: 0 0 0 2px rgba(0,123,255,0.1) !important;
}
/* Boutons */
.multi_submit {
display: flex !important;
gap: 12px !important;
margin-top: 20px !important;
}
.btn-primary {
flex: 1 !important;
background: #007bff !important;
border: none !important;
padding: 8px !important;
border-radius: 6px !important;
font-size: 13px !important;
font-weight: 500 !important;
cursor: pointer !important;
color: white !important;
text-align: center !important;
transition: background 0.2s !important;
}
.btn-primary:hover {
background: #0056b3 !important;
}
/* Cacher les icônes */
.pre-icon {
display: none !important;
}
/* Petits drapeaux décoratifs */
.small-flags {
position: fixed !important;
bottom: 20px !important;
right: 20px !important;
z-index: 2 !important;
display: flex !important;
gap: 5px !important;
}
.small-flag {
width: 30px !important;
height: 20px !important;
background: linear-gradient(135deg, #3b6e2c 33%, #ffffff 33%, #ffffff 66%, #cf0921 66%) !important;
border-radius: 3px !important;
animation: smallFlagWave 1s ease-in-out infinite !important;
}
@keyframes smallFlagWave {
0%, 100% {
transform: rotate(0deg);
}
50% {
transform: rotate(5deg);
}
}
/* Responsive */
@media (max-width: 500px) {
.auth-box-w {
max-width: 95% !important;
margin: 15px auto !important;
padding: 18px 18px 22px 18px !important;
}
.logo-w img {
max-width: 60px !important;
}
.multi_submit {
flex-direction: column !important;
gap: 8px !important;
}
.flag-wave {
transform: translate(-50%, -50%) scale(0.4) !important;
}
}
</style>
{% endblock %}
{% block fos_user_script %}
{{ parent() }}
<script>
change_submit_name();
$('#userbundle_user_validCode').on('input', function(e) {
change_submit_name();
});
function change_submit_name() {
if($('#userbundle_user_validCode').val().length > 0) {
$('#submit_change_password').val("Initialiser votre mot de passe");
} else {
$('#submit_change_password').val("Demander le code");
}
}
// animations supplémentaires
$(document).ready(function() {
// Créer des petites particules aux couleurs du drapeau
setInterval(function() {
var colors = ['#3b6e2c', '#ffffff', '#cf0921', '#f3c300'];
var particle = $('<div class="flag-particle"></div>');
particle.css({
position: 'fixed',
width: '5px',
height: '5px',
background: colors[Math.floor(Math.random() * colors.length)],
borderRadius: '50%',
bottom: '0px',
left: Math.random() * window.innerWidth + 'px',
opacity: Math.random() * 0.5 + 0.2,
zIndex: 1,
pointerEvents: 'none'
});
$('body').append(particle);
particle.animate({
bottom: window.innerHeight + 'px',
opacity: 0
}, Math.random() * 3000 + 2000, function() {
particle.remove();
});
}, 500);
});
</script>
{% endblock %}