/* Écrans « Mot de passe oublié » et « Nouveau mot de passe » de la Gestion (28/10/2026).
   Même habillage que login.php (photo des cultures à gauche, formulaire à droite, Plus Jakarta Sans, vert de la
   marque) : ils gardaient l'ancien design (logo B2B, bouton bleu, vidéo de 1,8 Mo, Font Awesome). */

:root {
    --green-50: #f0fdf4;
    --green-200: #bbf7d0;
    --green-400: #4ade80;
    --green-500: #36b080;
    --green-600: #16a34a;
    --green-700: #15803d;
    --green-800: #166534;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

.ico {
    width: 1em; height: 1em; flex: none;
    fill: none; stroke: currentColor; stroke-width: 2.25;
    stroke-linecap: round; stroke-linejoin: round;
    vertical-align: -0.135em;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    display: flex;
    background: var(--slate-50);
    overflow-x: hidden;
    color: var(--slate-800);
}

/* ───── Gauche : la photo des cultures ───── */
.visual-panel {
    flex: 1;
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 3rem;
    min-height: 100vh;
    overflow: hidden;
    background: var(--slate-900);
}

/* Image demandée seulement au-dessus de 1024 px : en dessous, le panneau n'est pas affiché. */
@media (min-width: 1025px) {
    .visual-panel {
        background-image: url('../videos/login-poster-1400.jpg');
        background-image: image-set(url('../videos/login-poster.webp') type('image/webp'),
                                    url('../videos/login-poster-1400.jpg') type('image/jpeg'));
        background-position: center;
        background-size: cover;
        background-repeat: no-repeat;
    }
}

.visual-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.72) 0%, rgba(20, 83, 45, 0.55) 100%),
        linear-gradient(180deg, transparent 40%, rgba(15, 23, 42, 0.85) 100%);
}

.visual-content {
    position: relative;
    max-width: 520px;
    animation: fadeUp 0.55s ease 0.09s both;
}

.visual-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 100px;
    padding: 8px 18px;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.visual-badge .ico { color: var(--green-400); }

.visual-content h2 {
    font-size: 2.8rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.visual-content h2 span {
    background: linear-gradient(135deg, var(--green-400), #86efac);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.visual-content p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.65;
    max-width: 440px;
}

/* ───── Droite : le formulaire ───── */
.form-panel {
    width: 520px;
    min-width: 520px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
    background: #fff;
    position: relative;
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.08);
}

.form-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--green-400), var(--green-600), var(--green-800));
}

.form-inner {
    max-width: 380px;
    width: 100%;
    margin: 0 auto;
    animation: fadeUp 0.55s ease 0.04s both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-logo { margin-bottom: 2.75rem; }
.form-logo img { height: 60px; width: auto; display: block; }

.form-heading {
    margin-bottom: 0.5rem;
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--slate-900);
    letter-spacing: -0.5px;
}

.form-subheading {
    font-size: 0.95rem;
    color: var(--slate-500);
    line-height: 1.55;
    margin-bottom: 1.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--slate-100);
}

.alert {
    padding: 0.85rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert .ico { font-size: 1.05rem; margin-top: 1px; }

.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: var(--green-50); color: var(--green-800); border: 1px solid var(--green-200); }

.field { margin-bottom: 1.25rem; }

.field-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--slate-600);
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}

.input-wrap { position: relative; display: flex; align-items: center; }

.input-wrap .icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--slate-400);
    font-size: 0.95rem;
    pointer-events: none;
    transition: color 0.25s;
}

.input-wrap:focus-within .icon { color: var(--green-500); }

.input-wrap input {
    width: 100%;
    padding: 0.85rem 0.85rem 0.85rem 2.7rem;
    border: 1.5px solid var(--slate-200);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 500;
    color: var(--slate-800);
    background: var(--slate-50);
    outline: none;
    transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.input-wrap input.with-toggle { padding-right: 2.8rem; }
.input-wrap input::placeholder { color: var(--slate-500); font-weight: 400; }

.input-wrap input:focus {
    border-color: var(--green-500);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(54, 176, 128, 0.1);
}

.password-toggle {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--slate-500);
    cursor: pointer;
    padding: 6px;
    font-size: 0.95rem;
    line-height: 1;
    border-radius: 6px;
}

.password-toggle:hover { color: var(--slate-800); }
.password-toggle:focus-visible { outline: 2px solid var(--green-500); outline-offset: 1px; }

/* Jauge de solidité du nouveau mot de passe */
.password-strength {
    height: 4px;
    margin-top: 8px;
    border-radius: 4px;
    background: var(--slate-100);
    overflow: hidden;
}

.password-strength-bar { height: 100%; width: 0; border-radius: 4px; transition: width 0.3s ease, background 0.3s ease; }
.password-strength-bar.weak { width: 33%; background: #ef4444; }
.password-strength-bar.medium { width: 66%; background: #f59e0b; }
.password-strength-bar.strong { width: 100%; background: var(--green-600); }

.password-requirements {
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.84rem;
    color: var(--slate-600);
}

.password-requirements h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--slate-800);
    margin-bottom: 0.4rem;
}

.password-requirements h4 .ico { color: var(--green-600); }
.password-requirements ul { list-style: none; display: grid; gap: 0.2rem; }
.password-requirements li { padding-left: 1.1rem; position: relative; line-height: 1.45; }

.password-requirements li::before {
    content: '';
    position: absolute;
    left: 0.2rem;
    top: 0.55em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--green-500);
}

.btn-primary {
    width: 100%;
    padding: 0.85rem;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--green-600) 0%, var(--green-700) 100%);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(22, 163, 74, 0.4);
    background: linear-gradient(135deg, var(--green-500) 0%, var(--green-700) 100%);
}

.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-primary.loading .btn-text { display: none; }
.btn-primary.loading .spinner { display: block; }

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

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 1.5rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--slate-600);
    text-decoration: none;
}

.back-link:hover { color: var(--green-700); }

.form-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--slate-100);
    font-size: 0.8rem;
    color: var(--slate-500);
}

.form-footer .ico { color: var(--green-400); margin-right: 4px; }

/* ───── Tablette et téléphone : le formulaire seul, comme la connexion ───── */
@media (max-width: 1024px) {
    .visual-panel { display: none; }

    .form-panel {
        width: 100%;
        min-width: 0;
        box-shadow: none;
        justify-content: flex-start;
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    .form-panel::before { display: none; }
}

@media (max-width: 640px) {
    .form-panel { padding: 2rem 1.5rem; }
    .form-heading { font-size: 1.5rem; }
}

@media (max-width: 375px) {
    .form-panel { padding: 1.5rem 1.25rem; }
    .form-logo img { height: 48px; }
    .form-heading { font-size: 1.35rem; }
}

@supports (-webkit-touch-callout: none) {
    body, .visual-panel, .form-panel { min-height: 100dvh; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
