/* amn-wizard.css — Agence Maritale du Niger v2.4.0
 * MODULE WIZARD — Chargé uniquement sur les pages : inscription, connexion, profil.
 * Contient : formulaires, wizard 3-étapes, photo preview, phone wrapper,
 *            date picker, barre de navigation wizard, validation inline,
 *            formulaire de connexion.
 * ========================================================================= */

/* Styles pour les pages de formulaires (Inscription, Connexion) */
.im-form-container {
    background: linear-gradient(135deg, var(--im-vert-clair), var(--im-bleu-ciel));
    padding: 2em;
    border-radius: 15px;
    max-width: 800px;
    margin: 2em auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    color: var(--im-gris-fonce);
}

/* [FIX-CSS-02] Mobile-first : adaptation du conteneur de formulaire sur petit écran.
 * Desktop (> 768px) reste la source de vérité. Ces surcharges réduisent le padding
 * et les marges sur mobile pour éviter le débordement et optimiser l'espace tactile. */
@media (max-width: 768px) {
    .im-form-container {
        padding: 1.4em 1.2em;
        margin: 1em auto;
        border-radius: 10px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }
}

@media (max-width: 480px) {
    .im-form-container {
        padding: 1.1em 0.9em;
        margin: 0.5em auto;
        border-radius: 8px;
        box-shadow: none; /* Supprime l'ombre sur très petit écran — gain de rendu */
    }

    /* Champs de formulaire : taille de police plus grande (≥ 16px) pour éviter
     * le zoom automatique de Safari iOS lors du focus sur un <input> */
    .im-form-field input[type="text"],
    .im-form-field input[type="email"],
    .im-form-field input[type="password"],
    .im-form-field input[type="tel"],
    .im-form-field select,
    .im-form-field textarea {
        font-size: 16px;
    }
}

.im-form-container h4 {
    color: var(--im-rose);
    text-align: center;
    margin-bottom: 1.5em;
    font-weight: bold;
}

.im-form-field {
    margin-bottom: 1.5em;
}

.im-form-field label {
    display: block;
    margin-bottom: 0.5em;
    color: var(--im-rose);
    font-weight: 600;
}

.im-form-field input[type="text"],
.im-form-field input[type="email"],
.im-form-field input[type="password"],
.im-form-field input[type="tel"],
.im-form-field select,
.im-form-field textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: var(--im-blanc);
    box-sizing: border-box;
    transition: border-color 0.3s;
    color: #333;
}

/* Style pour la première option (placeholder) des listes déroulantes */
.im-form-field select:required:invalid {
    color: #757575; /* Une couleur grise pour le placeholder, plus visible */
}
.im-form-field option {
    color: #333; /* Couleur de texte normale pour les autres options */
}

/* Conteneur pour le champ mot de passe pour positionner l'icône */
.im-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
/* L'input prend toute la largeur sauf l'espace pour le bouton oeil */
.im-password-wrapper input[type="password"],
.im-password-wrapper input[type="text"] {
    padding-right: 48px;
    width: 100%;
}
/* Fix #3 — Bouton oeil SVG : remplace dashicons, zero dépendance admin */
.im-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #757575;
    background: none;
    border: none;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.2s ease;
    line-height: 1;
    /* Dashicons (rétrocompatibilité ancien template) */
    font-size: 20px;
}
.im-password-toggle:hover,
.im-password-toggle:focus {
    color: var(--im-rose);
    outline: none;
}
/* Icône SVG dans le bouton */
.amn-eye-icon {
    width: 20px;
    height: 20px;
    display: block;
    pointer-events: none;
    stroke: currentColor;
}

.im-form-field input:focus,
.im-form-field select:focus,
.im-form-field textarea:focus {
    border-color: var(--im-rose);
    outline: none;
}

.im-form-field textarea {
    min-height: 120px;
    resize: vertical;
}

.im-form-field .im-field-description {
    font-size: 0.85em;
    color: #555;
    margin-top: 5px;
}

.im-word-counter {
    font-size: 0.9em;
    margin-top: 5px;
    font-weight: bold;
    transition: color 0.3s ease-in-out;
}
.im-word-counter-error {
    color: #c0392b; /* Rouge pour l'erreur */
}
.im-word-counter-success {
    color: #27ae60; /* Vert pour le succès */
}

.im-form-field .im-error-message {
    color: #D32F2F;
    font-size: 0.9em;
    margin-top: 5px;
    display: none; /* Affiché via JS */
}

/* Styles pour les boutons */
.im-button,
.im-form-container button {
    background-color: var(--im-rose);
    color: var(--im-blanc);
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.3s, transform 0.2s;
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.im-button:hover,
.im-form-container button:hover {
    background-color: #C2185B;
    transform: translateY(-2px);
}

.im-button-save {
    background-color: #4CAF50; /* Vert pour sauvegarder */
}
.im-button-save:hover {
    background-color: #388E3C;
}


/* ==========================================================================
   NOUVELLES FONCTIONNALITÉS — Agence Maritale Niger
   #1 Favoris | #2 Compatibilité | #3 Photo Preview | #4 Wizard
   #5 Inline Errors | #6 Notifications in-app
   Mobile-first — desktop is source of truth
========================================================================== */

/* --------------------------------- */
/* #3 PRÉVISUALISATION PHOTOS        */
/* --------------------------------- */

.amn-photo-preview-zone {
    margin-top: 10px;
    min-height: 0;
}

.amn-photo-preview-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0faf5;
    border: 1.5px solid #A8E6CF;
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 8px;
}

.amn-photo-preview-img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #A8E6CF;
    flex-shrink: 0;
}

.amn-preview-label {
    font-size: 13px;
    color: #27ae60;
    font-weight: 600;
}

.amn-preview-error {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #e74c3c;
    font-weight: 600;
}

/* --------------------------------- */
/* #4 WIZARD INSCRIPTION             */
/* --------------------------------- */

.amn-wizard-progress {
    max-width: 800px;
    margin: 0 auto 1.5em auto;
}

.amn-wizard-progress-bar {
    background: #e0e0e0;
    border-radius: 50px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 10px;
}

.amn-wizard-progress-fill {
    background: linear-gradient(90deg, var(--im-rose), #ff6b9d);
    height: 100%;
    border-radius: 50px;
    transition: width 0.4s ease;
    width: 0%;
}

.amn-wizard-steps-labels {
    display: flex;
    justify-content: space-between;
    gap: 5px;
}

.amn-wizard-step-label {
    font-size: 11px;
    color: #aaa;
    font-weight: 500;
    text-align: center;
    flex: 1;
    transition: color 0.3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.amn-wizard-step-label.is-active {
    color: var(--im-rose);
    font-weight: 700;
}

.amn-wizard-step-label.is-done {
    color: #27ae60;
}

.amn-wizard-step-label.is-done::before {
    content: '✓ ';
}

/* Transition douce entre étapes */
.amn-wizard-step {
    animation: amnFadeIn 0.3s ease;
}

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

.amn-step-title {
    color: var(--im-rose);
    font-size: 1.1em;
    margin-bottom: 1.2em;
    padding-bottom: 0.5em;
    border-bottom: 2px solid var(--im-vert-clair);
}

.amn-wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.amn-wizard-nav .im-button {
    min-width: 140px;
    text-align: center;
}

.amn-wizard-recap {
    background: #f0fdf4;
    border: 1.5px solid #A8E6CF;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 20px 0 10px;
}

.amn-recap-text {
    margin: 0;
    font-size: 14px;
    color: #27ae60;
    font-weight: 600;
}

/* Champ invalide dans le wizard */
.amn-field-invalid {
    border-color: #e74c3c !important;
    background-color: #fff5f5 !important;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.15) !important;
}

/* --------------------------------- */
/* #5 ERREURS INLINE                 */
/* --------------------------------- */

.amn-inline-error {
    display: none;
    color: #e74c3c;
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
    line-height: 1.4;
}

.amn-field-valid {
    border-color: #27ae60 !important;
    background-color: #f0fdf4 !important;
}

/* --------------------------------- */
/* #1 SYSTÈME DE FAVORIS             */
/* --------------------------------- */

.amn-fav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 2px solid var(--im-rose);
    color: var(--im-rose);
    border-radius: 50px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s ease;
    line-height: 1;
    text-decoration: none;
}

.amn-fav-btn:hover {
    background: var(--im-rose);
    color: #fff;
    transform: scale(1.08);
}

.amn-fav-btn.is-fav {
    background: var(--im-rose);
    color: #fff;
}

.amn-fav-btn.is-fav:hover {
    background: #c0134d;
    border-color: #c0134d;
}

.amn-fav-icon {
    pointer-events: none;
}

/* Onglet Favoris dans le dashboard */
.amn-favoris-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.amn-fav-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.amn-fav-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.amn-fav-item img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
    filter: blur(4px);
    border: 3px solid var(--im-vert-clair);
}

.amn-fav-item-info {
    font-size: 13px;
    color: #555;
    margin-bottom: 8px;
}

.amn-no-favoris {
    text-align: center;
    color: #aaa;
    padding: 30px;
    font-style: italic;
}

/* --------------------------------- */
/* #2 SCORE DE COMPATIBILITÉ         */
/* --------------------------------- */

.amn-compat-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: var(--compat-color, #888);
    color: #fff;
    border-radius: 8px;
    padding: 5px 10px;
    margin-top: 8px;
    font-size: 12px;
    min-width: 70px;
    line-height: 1.2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.amn-compat-score {
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
}

.amn-compat-label {
    font-size: 10px;
    font-weight: 500;
    text-align: center;
    opacity: 0.92;
    white-space: nowrap;
}

/* ==========================================================================
   RESPONSIVE MOBILE — Toutes nouvelles features
========================================================================== */

@media (max-width: 768px) {

    /* #3 Photo preview */
    .amn-photo-preview-img {
        width: 52px;
        height: 52px;
    }

    /* #4 Wizard */
    .amn-wizard-step-label {
        font-size: 10px;
    }

    .amn-wizard-nav {
        flex-direction: column;
    }

    .amn-wizard-nav .im-button {
        width: 100%;
    }

    /* #1 Favoris */
    .amn-favoris-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* #6 Notifications toast — pleine largeur sur mobile */
    .amn-inapp-notif {
        right: 10px;
        left: 10px;
        max-width: none;
        bottom: 70px;
        font-size: 12px;
    }

    /* #2 Compatibilité — badge plus compact */
    .amn-compat-score {
        font-size: 15px;
    }

    .amn-compat-label {
        font-size: 9px;
    }
}

@media (max-width: 480px) {

    /* #4 Wizard : labels ultra-courts sur très petits écrans */
    .amn-wizard-steps-labels {
        flex-direction: row;
    }

    .amn-wizard-step-label {
        font-size: 9px;
    }

    /* #1 Favoris */
    .amn-favoris-list {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .amn-fav-item {
        padding: 8px;
    }

    .amn-fav-item img {
        width: 55px;
        height: 55px;
    }
}

/* --------------------------------- */
/* CARD ACTIONS (Voir profil + Favori sur la grille des annonces) */
/* --------------------------------- */

.im-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.im-btn-voir-profil {
    color: var(--im-rose);
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
    flex: 1;
}

.im-btn-voir-profil:hover {
    color: #c0134d;
    text-decoration: underline;
}

/* Onglet description */
.amn-tab-desc {
    color: #777;
    font-size: 13px;
    margin-bottom: 15px;
    font-style: italic;
}

@media (max-width: 768px) {
    .im-card-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .amn-fav-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   CORRECTIONS — Wizard, Favoris mobile, Alerte photo
   Ajoutées suite aux bugs constatés en production (mai 2026)
========================================================================== */

/* ---- Description alerte (rouge) ---- */
.im-field-description--alert {
    color: #c0392b;
    font-style: italic;
    border: 0.5px solid #c0392b;
    padding: 6px 8px;
    border-radius: 5px;
    background-color: #fdf2f0;
    display: block;
    margin-bottom: 10px;
}

/* ---- Wizard : nav finale (étape 3) ---- */
.amn-wizard-nav--final {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}

.amn-wizard-nav--submit-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.im-button--submit {
    background: var(--im-rose);
    color: #fff;
    font-size: 16px;
    padding: 14px 20px;
    width: 100%;
    text-align: center;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.im-button--submit:hover {
    background: #c0134d;
}

/* ---- Wizard : boutons pleine largeur sur mobile ---- */
.amn-wizard-nav .im-button,
.amn-wizard-nav .amn-wizard-prev,
.amn-wizard-nav .amn-wizard-next {
    min-width: 130px;
}

/* ---- Favoris : toujours visible et cliquable sur mobile ---- */
/* Force l'affichage du bouton favori sur toutes les tailles d'écran */
.amn-fav-btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    cursor: pointer;
    user-select: none;
}

/* Sur les cartes, le bouton favori occupe toute la largeur sur très petit écran */
@media (max-width: 480px) {
    .im-card-actions {
        flex-direction: column;
        gap: 8px;
    }

    .amn-fav-btn {
        width: 100%;
        justify-content: center;
        padding: 10px 14px;
        font-size: 20px;
    }

    .im-btn-voir-profil {
        display: block;
        text-align: center;
        padding: 8px 0;
    }

    /* Wizard nav : empilé verticalement */
    .amn-wizard-nav {
        flex-direction: column;
        gap: 10px;
    }

    .amn-wizard-nav .im-button,
    .amn-wizard-nav .amn-wizard-prev,
    .amn-wizard-nav .amn-wizard-next {
        width: 100%;
        text-align: center;
    }

    .amn-wizard-steps-labels {
        gap: 2px;
    }

    .amn-wizard-step-label {
        font-size: 9px;
    }
}

/* ---- Erreurs inline : espacement correct ---- */
/* [FIX-CSS-01] Règle .amn-inline-error dupliquée supprimée.
 * L'ancienne déclaration contenait "display:none" PUIS "display:block" dans le
 * même bloc, forçant les erreurs à toujours s'afficher indépendamment du JS.
 * La règle canonique est conservée plus haut (display:none par défaut).
 * Le JS (initInlineValidation + _setFieldError) gère l'affichage via .show()/.hide(). */
.amn-inline-error:empty {
    display: none !important;
}

/* ---- Wizard progress fill : transition fluide ---- */
.amn-wizard-progress-fill {
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   WIZARD — Barre de navigation unique (architecture révisée)
   #amn-wizard-nav-bar est hors du <form>, contrôlé par JS via IDs uniques.
========================================================================== */

/* Conteneur principal de la barre nav */
#amn-wizard-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
    padding: 0 0 30px 0;
    flex-wrap: wrap;
}

/* Groupe droite : Suivant / Sauvegarder / S'inscrire */
.amn-wizard-nav-right {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    align-items: flex-end;
}

/* Bouton Suivant */
#amn-btn-next {
    min-width: 160px;
    text-align: center;
}

/* Bouton Précédent */
#amn-btn-prev {
    min-width: 130px;
}

/* Bouton S'inscrire */
#amn-submit-btn {
    background: var(--im-rose, #E91E63);
    color: #fff;
    font-size: 15px;
    padding: 13px 22px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    width: 100%;
    max-width: 320px;
    transition: background 0.2s;
}
#amn-submit-btn:hover { background: #c0134d; }
#amn-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Bouton Sauvegarder */
#im-save-later-btn-bottom {
    width: 100%;
    max-width: 320px;
    text-align: center;
    background: #888;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 11px 20px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}
#im-save-later-btn-bottom:hover { background: #666; }

/* Groupes photo */
.amn-photo-upload-group {
    margin-bottom: 16px;
    padding: 12px;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
}
.amn-photo-upload-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 13px;
}
.amn-photo-upload-group input[type="file"] {
    display: block;
    width: 100%;
}

/* Barre de progression — correction du sélecteur */
.amn-wizard-progress-track {
    background: #e0e0e0;
    border-radius: 50px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 10px;
}

/* ---- RESPONSIVE MOBILE ---- */
@media (max-width: 600px) {

    #amn-wizard-nav-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding-bottom: 80px; /* espace pour la bottom nav */
    }

    .amn-wizard-nav-right {
        align-items: stretch;
    }

    #amn-btn-next,
    #amn-btn-prev {
        width: 100%;
        text-align: center;
        min-width: unset;
        padding: 14px 20px;
        font-size: 15px;
    }

    #amn-submit-btn,
    #im-save-later-btn-bottom {
        max-width: 100%;
    }
}

/* ====================================================================
   Fix #2 — CHAMP TÉLÉPHONE NATIF (v2.5.0)
   Sélecteur d'indicatif + input numérique — zéro dépendance externe
/* ====================================================================
   [FIX-PHONE-CSS-01] v2.4.0 — CORRECTION CRITIQUE CHAMP TÉLÉPHONE
   PROBLÈME : La règle globale .im-form-field input[type="tel"] appliquait
   width:100% et border:1px solid #ccc au .amn-phone-number DANS le flex
   wrapper. Combiné avec la règle .im-form-field select width:100% sur
   .amn-phone-indicatif, les deux éléments tentaient de prendre 100% de
   largeur dans le même flex container → l'input était invisible (repoussé
   hors du conteneur ou écrasé par le select).
   SOLUTION : on neutralise explicitement les surcharges globales à l'intérieur
   de .amn-phone-wrapper avec des sélecteurs plus spécifiques.
   ==================================================================== */

/* Conteneur flex : donne l'apparence d'un seul champ unifié */
.amn-phone-wrapper {
    display: flex;
    align-items: stretch;
    gap: 0;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.3s;
    background: var(--im-blanc);
    width: 100%; /* le wrapper lui-même prend 100% */
}

.amn-phone-wrapper:focus-within {
    border-color: var(--im-rose);
    box-shadow: 0 0 0 2px rgba(232, 67, 147, 0.12);
}

/* [FIX-PHONE-CSS-01] Neutralisation de la règle globale
   .im-form-field select { width:100% }
   Le select indicatif ne doit PAS prendre 100% — il a une largeur fixe */
.amn-phone-wrapper .amn-phone-indicatif,
.im-form-field .amn-phone-wrapper select,
.im-form-field .amn-phone-wrapper .amn-phone-indicatif {
    flex-shrink: 0;
    width: auto !important;       /* neutralise width:100% de la règle globale */
    min-width: 110px;
    max-width: 140px;
    padding: 11px 8px 11px 12px;
    border: none !important;      /* neutralise border:1px de la règle globale */
    border-right: 1px solid #ddd !important;
    border-radius: 0 !important;  /* neutralise border-radius:8px global */
    background: #f7f7f7 !important;
    background-color: #f7f7f7 !important;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    appearance: auto;
    outline: none;
    box-shadow: none !important;
}

.amn-phone-wrapper .amn-phone-indicatif:focus,
.im-form-field .amn-phone-wrapper select:focus {
    background: #f0e9f4 !important;
    border-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
}

/* [FIX-PHONE-CSS-01] Neutralisation de la règle globale
   .im-form-field input[type="tel"] { width:100%; border:1px solid #ccc }
   L'input numéro doit s'étirer avec flex:1, pas width:100% */
.amn-phone-wrapper .amn-phone-number,
.im-form-field .amn-phone-wrapper input[type="tel"],
.im-form-field .amn-phone-wrapper .amn-phone-number {
    flex: 1 1 auto !important;    /* s'étire pour remplir l'espace restant */
    width: auto !important;       /* neutralise width:100% de la règle globale */
    min-width: 80px;              /* évite le collapse sur petit écran */
    padding: 12px 14px;
    border: none !important;      /* neutralise border:1px de la règle globale */
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    color: #333;
    font-size: 15px;
    outline: none;
    box-shadow: none !important;
    /* Évite que :focus ajoute border-color sur l'input interne */
    border-color: transparent !important;
}

.amn-phone-wrapper .amn-phone-number:focus,
.im-form-field .amn-phone-wrapper input[type="tel"]:focus {
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

/* États valid/invalid sur l'input (coloration fond) */
.amn-phone-number.amn-field-invalid,
.amn-phone-wrapper .amn-phone-number.amn-field-invalid {
    background-color: #fff5f5 !important;
}
.amn-phone-number.amn-field-valid,
.amn-phone-wrapper .amn-phone-number.amn-field-valid {
    background-color: #f0fdf4 !important;
}

/* [FIX-CSS-04] Mobile : font-size ≥ 16px anti-zoom Safari iOS
   Safari iOS zoome automatiquement sur tout input focusé < 16px */
@media (max-width: 480px) {
    .amn-phone-wrapper .amn-phone-indicatif,
    .im-form-field .amn-phone-wrapper select {
        min-width: 90px !important;
        max-width: 120px !important;
        font-size: 16px !important;
        padding: 11px 4px 11px 8px !important;
    }
    .amn-phone-wrapper .amn-phone-number,
    .im-form-field .amn-phone-wrapper input[type="tel"] {
        font-size: 16px !important;
        padding: 12px 10px !important;
    }
}

/* ====================================================================
   Fix #4 — DATE DE NAISSANCE NATIVE (v2.5.0)
   Input texte masqué JJ/MM/AAAA — zéro flatpickr
   ==================================================================== */

/* ====================================================================
   [FIX-DOB-CSS-01] v2.4.0 — Date de naissance : wrapper pleine largeur
   + neutralisation de la règle globale input[type="text"] width:100%
   qui causait un double-border (le wrapper et l'input avaient chacun
   leur propre border 1px, créant une double ligne).
   ==================================================================== */

.amn-dob-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%; /* [FIX-DOB-CSS-01] s'assure que le wrapper prend toute la largeur */
}

/* L'input interne gère son propre style — pas besoin du border global */
.amn-dob-wrapper .amn-dob-input,
.im-form-field .amn-dob-wrapper input[type="text"] {
    width: 100%;
    padding: 12px 42px 12px 15px; /* padding-right pour l'icône calendrier */
    border: 1px solid #ccc !important;
    border-radius: 8px !important;
    background: var(--im-blanc) !important;
    font-size: 15px;
    color: #333;
    letter-spacing: 0.5px;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
    outline: none;
}

.amn-dob-wrapper .amn-dob-input:focus,
.im-form-field .amn-dob-wrapper input[type="text"]:focus {
    border-color: var(--im-rose) !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(232, 67, 147, 0.12) !important;
}

/* Icône calendrier décorative — pointer-events:none pour laisser le clic passer à l'input */
.amn-dob-icon {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
    display: flex;
    align-items: center;
}

.amn-dob-input.amn-field-valid,
.amn-dob-wrapper .amn-dob-input.amn-field-valid {
    border-color: #27ae60 !important;
    background: #f0fdf4 !important;
}
.amn-dob-input.amn-field-invalid,
.amn-dob-wrapper .amn-dob-input.amn-field-invalid {
    border-color: #e74c3c !important;
    background: #fff5f5 !important;
}

/* [FIX-CSS-04b] font-size ≥ 16px sur mobile — anti-zoom Safari iOS */
@media (max-width: 480px) {
    .amn-dob-wrapper .amn-dob-input,
    .im-form-field .amn-dob-wrapper input[type="text"] {
        font-size: 16px !important;
    }
}


/* Connexion : conteneur plus étroit (pas de wizard 3-steps) */
.im-form-container--login {
    max-width: 480px;
}

/* Titre du formulaire de connexion */
.im-login-title {
    color: var(--im-rose);
    text-align: center;
    font-size: 1.4em;
    font-weight: 700;
    margin-bottom: 1.2em;
    padding-bottom: 0.5em;
    border-bottom: 2px solid var(--im-vert-clair);
}

/* Bouton de connexion — pleine largeur pour confort tactile */
.im-button--login-submit {
    display: block;
    width: 100%;
    padding: 14px 20px;
    font-size: 1.1em;
    font-weight: 700;
    text-align: center;
    margin-top: 0.5em;
    border-radius: 8px;
    cursor: pointer;
    letter-spacing: 0.03em;
}

/* Liens du bas (mot de passe oublié, inscription) */
.im-login-link {
    margin-top: 1em;
    text-align: center;
    font-size: 0.95em;
    color: #555;
}

.im-login-link a {
    color: var(--im-rose);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.im-login-link a:hover {
    color: #c0134d;
    text-decoration: underline;
}

/* Message d'accroche en bas */
.im-login-catchphrase {
    margin-top: 1.5em;
    text-align: center;
    color: var(--im-rose);
    font-weight: 700;
    font-size: 0.92em;
    line-height: 1.4;
    padding: 0.5em 0;
    border-top: 1px dashed rgba(233,30,99,0.2);
}

/* Case "Se souvenir de moi" — espacement et alignement */
.im-form-field--checkbox {
    margin-bottom: 1em;
}

.im-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.95em;
    color: #555;
    font-weight: 400;
    user-select: none;
}

.im-checkbox-label input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--im-rose); /* Couleur de la case cochée — Chrome 93+, FF 92+ */
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .im-login-title {
        font-size: 1.2em;
    }

    .im-button--login-submit {
        font-size: 1em;
        padding: 13px 16px;
    }
}


/* ==========================================================================
   [FIX-CSS-05] MESSAGES AJAX — .im-form-messages, .im-success, .im-error
   Générés par handleFormSubmit() dans im-public.js.
   Sans ces règles, les messages de succès/erreur s'affichent en texte brut
   sans distinction visuelle sur le fond dégradé du .im-form-container.
========================================================================== */

.im-form-messages {
    margin-bottom: 1.2em;
    border-radius: 8px;
    overflow: hidden;
}

.im-form-messages p {
    margin: 0;
    padding: 12px 16px;
    font-size: 0.95em;
    font-weight: 600;
    line-height: 1.5;
    border-radius: 8px;
}

/* Message de succès (inscription réussie, connexion, sauvegarde profil) */
.im-form-messages .im-success,
p.im-success {
    background-color: #d4edda;
    color: #1a5c2e;
    border: 1px solid #a3d7b0;
    border-left: 4px solid #27ae60;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    line-height: 1.5;
    margin: 0;
}

/* Message d'erreur (champ manquant, email utilisé, mot de passe incorrect…) */
.im-form-messages .im-error,
p.im-error {
    background-color: #fdecea;
    color: #7b1e1e;
    border: 1px solid #f5c2c0;
    border-left: 4px solid #e74c3c;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    line-height: 1.5;
    margin: 0;
}

@media (max-width: 480px) {
    .im-form-messages .im-success,
    p.im-success,
    .im-form-messages .im-error,
    p.im-error {
        font-size: 0.9em;
        padding: 10px 12px;
    }
}
