/* =====================================================================
   Écran de connexion WordPress (wp-login.php) aux couleurs d'Africuni / Spark.
   Feuille AUTONOME : elle ne dépend pas de main.css (qui stylerait body, a, h1... globalement).
   Chargée par Africuni\Login::enqueue_style().
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

body.login {
    --af-forest-dark: #051C12;
    --af-forest-medium: #072F1F;
    --af-accent-hover: #f84e24;
    --af-accent-soft: rgba(180, 241, 5, 0.15);
    --af-text: #0B130F;
    --af-muted: #7e706c;
    --af-bg: #F4F6F5;
    --af-border: #E9EFEF;
    --af-red-bg: #FEE2E2;
    --af-green-bg: #DCFCE7;

    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--af-bg);
    color: var(--af-text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    box-sizing: border-box;
    position: relative;
    overflow-x: hidden;
}

/* Décoration de fond (les deux halos du template) */
body.login::before,
body.login::after {
    content: "";
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle, var(--af-accent-soft) 0%, rgba(180, 241, 5, 0) 70%);
}
body.login::before { width: 300px; height: 300px; top: -50px; left: -50px; }
body.login::after  { width: 400px; height: 400px; bottom: -100px; right: -50px; }

/* La carte : tout le bloc #login */
body.login #login {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    padding: 2.5rem;
    box-sizing: border-box;
    background: #FFFFFF;
    border: 1px solid var(--af-border);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(11, 19, 15, 0.08);
}

/* Logo : astérisque + nom de l'application */
body.login h1 { margin: 0 0 1.5rem; }
body.login h1 a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: auto;
    height: auto;
    margin: 0;
    background: none;
    text-indent: 0;
    overflow: visible;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--af-forest-dark);
    transition: color .3s cubic-bezier(0.4, 0, 0.2, 1);
}
body.login h1 a::before {
    content: "";
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23072F1F' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 3v18M4.2 7.5l15.6 9M4.2 16.5l15.6-9'/%3E%3C/svg%3E") center / contain no-repeat;
    animation: af-rotate 15s linear infinite;
}
body.login h1 a:hover,
body.login h1 a:focus { color: var(--af-accent-hover); box-shadow: none; }

@keyframes af-rotate { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    body.login h1 a::before { animation: none; }
}

/* Sous-titre */
body.login .africuni-login-subtitle {
    margin: -0.75rem 0 1.75rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--af-muted);
}

/* Le formulaire n'a plus son propre cadre : la carte s'en charge */
body.login form {
    margin: 20px;
    padding: 8px;
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
}

body.login label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--af-text);
}

/* Champs */
body.login form .input,
body.login input[type="text"],
body.login input[type="password"],
body.login input[type="email"] {
    width: 100%;
    box-sizing: border-box;
    min-height: 0;
    height: auto;
    margin: 0 0 1.1rem;
    padding: 0.8rem 1.25rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--af-text);
    background: var(--af-bg);
    border: 1px solid var(--af-border);
    border-radius: 14px;
    box-shadow: none;
    outline: none;
    transition: all .25s ease-in-out;
}
body.login form .input:focus,
body.login input[type="text"]:focus,
body.login input[type="password"]:focus,
body.login input[type="email"]:focus {
    background: #FFFFFF;
    border-color: var(--af-forest-medium);
    box-shadow: 0 0 0 4px var(--af-accent-soft);
}

/* Mot de passe + bouton œil (aligné sur la hauteur du champ, marge basse exclue) */
body.login .wp-pwd { position: relative; }
body.login .wp-pwd input { padding-right: 3rem; }
body.login .wp-pwd .button.wp-hide-pw {
    position: absolute;
    top: 0;
    right: 0.35rem;
    height: calc(100% - 1.1rem);
    min-height: 0;
    margin: 0;
    padding: 0 0.6rem;
    color: var(--af-muted);
    background: transparent;
    border: 0;
    box-shadow: none;
}
body.login .wp-pwd .button.wp-hide-pw:hover,
body.login .wp-pwd .button.wp-hide-pw:focus { color: var(--af-forest-medium); background: transparent; box-shadow: none; }

/* « Se souvenir de moi » */
body.login .forgetmenot {
    float: none;
    margin: 0 0 1.25rem;
    font-size: 0.8rem;
}
body.login .forgetmenot label { display: inline; margin: 0; font-weight: 600; color: var(--af-muted); }
body.login input[type="checkbox"] {
    accent-color: var(--af-forest-medium);
    border-color: var(--af-border);
    margin-right: 0.4rem;
}
body.login input[type="checkbox"]:checked::before { color: var(--af-forest-medium); }

/* Bouton principal */
/* WordPress (login.min.css) impose « #login form p { margin-bottom: 0 } », plus prioritaire que nos classes.
   On l'annule ici, puis on redonne les marges voulues avec la même priorité. */
body.login #login form p { margin-bottom: 1em; }
body.login #login form p.forgetmenot { margin: 0 0 1.25rem; }
body.login #login form p.submit { margin: 1.75rem 0 0; }
body.login.wp-core-ui .button-primary {
    float: none;
    width: 100%;
    min-height: 0;
    padding: 0.85rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
    color: #FFFFFF;
    text-shadow: none;
    background: var(--af-forest-medium);
    border: 0;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(11, 19, 15, 0.02);
    transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
}
body.login.wp-core-ui .button-primary:hover,
body.login.wp-core-ui .button-primary:focus {
    background: var(--af-forest-dark);
    color: #FFFFFF;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--af-accent-soft);
}
body.login.wp-core-ui .button-primary:focus { outline: 2px solid var(--af-forest-medium); outline-offset: 2px; }

/* Messages (succès / info par défaut, erreur en rouge) */
body.login .message,
body.login .success,
body.login #login_error,
body.login .notice {
    margin: 0 0 1.25rem;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.5;
    color: #166534;
    background: var(--af-green-bg);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 14px;
    box-shadow: none;
}
body.login #login_error,
body.login .notice-error {
    color: #991B1B;
    background: var(--af-red-bg);
    border-color: rgba(239, 68, 68, 0.25);
}
body.login .message.reset-pass,
body.login .notice-info { color: var(--af-text); background: var(--af-bg); border-color: var(--af-border); }
body.login #login_error a { color: inherit; text-decoration: underline; }

/* Liens du bas */
body.login #nav,
body.login #backtoblog {
    margin: 1.1rem 0 0;
    padding: 0;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
}
body.login #nav a,
body.login #backtoblog a { color: var(--af-muted); text-decoration: none; transition: color .25s ease; }
body.login #nav a:hover,
body.login #backtoblog a:hover,
body.login #nav a:focus,
body.login #backtoblog a:focus { color: var(--af-accent-hover); box-shadow: none; }

/* Lien « ← Aller sur le site » masqué */
body.login #backtoblog { display: none; }

/* Sélecteur de langue masqué (aussi côté PHP) : la carte reste centrée */
body.login .language-switcher { display: none; }

@media (max-width: 480px) {
    body.login { padding: 1rem; }
    body.login #login { padding: 1.75rem 1.25rem; border-radius: 20px; }
}