/* ============================================================
   Club-IA — Page de connexion personnalisée (v2)
   ============================================================ */

/* ── Background pleine page ──────────────────────────────── */
body.login {
    background: linear-gradient( 135deg, #0f0c29 0%, #302b63 50%, #24243e 100% );
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    position: relative;
}

body.login::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient( ellipse at 20% 50%, rgba( 120, 60, 237, 0.18 ) 0%, transparent 60% ),
        radial-gradient( ellipse at 80% 20%, rgba( 219, 39, 119, 0.12 ) 0%, transparent 50% );
    pointer-events: none;
    z-index: 0;
}

/* ── Logo ────────────────────────────────────────────────── */
.login h1 a {
    background-image: url( 'https://club-ia.treco.fr/wp-content/uploads/2026/04/logo-club-ia-color.png' );
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
    width: 180px;
    height: 90px;
    display: block;
    margin: 0 auto 6px;
    box-shadow: none !important;
    outline: none;
}

/* ── Card blanche ────────────────────────────────────────── */
#login {
    background: #ffffff;
    border-radius: 24px;
    padding: 40px 40px 32px;
    width: 420px !important;
    max-width: calc( 100vw - 32px );
    box-shadow:
        0 0 0 1px rgba( 255, 255, 255, 0.06 ),
        0 24px 80px rgba( 0, 0, 0, 0.45 );
    position: relative;
    z-index: 1;
}

/* ── Sous-titre (injecté par JS) ─────────────────────────── */
.cia-login-subtitle {
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
    margin: 0 0 24px;
    line-height: 1.5;
}

/* ── Bouton SSO OpenID Connect ───────────────────────────── */
.openid-connect-login-button {
    margin: 0 0 0 !important;
    text-align: center !important;
}

.openid-connect-login-button a,
.openid-connect-login-button a.button,
.openid-connect-login-button a.button-large {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    width: 100% !important;
    background: linear-gradient( 135deg, #7c3aed 0%, #db2777 100% ) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 16px 24px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em !important;
    text-decoration: none !important;
    cursor: pointer !important;
    box-shadow: 0 4px 20px rgba( 124, 58, 237, 0.45 ) !important;
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s !important;
    text-shadow: none !important;
    height: auto !important;
    line-height: 1.4 !important;
    box-sizing: border-box !important;
    white-space: normal !important;
}

.openid-connect-login-button a::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    min-width: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

.openid-connect-login-button a:hover {
    opacity: 0.9 !important;
    transform: translateY( -2px ) !important;
    box-shadow: 0 8px 28px rgba( 124, 58, 237, 0.55 ) !important;
    color: #ffffff !important;
}

/* ── Formulaire admin (caché par JS) ─────────────────────── */
#loginform {
    border-top: 1px solid #f1f5f9;
    padding-top: 20px;
    margin-top: 20px;
}

/* ── Labels ──────────────────────────────────────────────── */
.login label {
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 6px;
}

/* ── Inputs ──────────────────────────────────────────────── */
.login input[type="text"],
.login input[type="password"],
.login input[type="email"] {
    border: 1.5px solid #e5e7eb !important;
    border-radius: 10px !important;
    padding: 11px 14px !important;
    width: 100% !important;
    font-size: 14px !important;
    color: #111827 !important;
    background: #f9fafb !important;
    box-shadow: none !important;
    transition: border-color 0.2s !important;
    box-sizing: border-box !important;
    height: auto !important;
}

.login input[type="text"]:focus,
.login input[type="password"]:focus,
.login input[type="email"]:focus {
    border-color: #7c3aed !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba( 124, 58, 237, 0.1 ) !important;
    outline: none !important;
}

/* ── Submit ──────────────────────────────────────────────── */
.login #wp-submit {
    background: linear-gradient( 135deg, #7c3aed 0%, #db2777 100% ) !important;
    border: none !important;
    border-radius: 10px !important;
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    padding: 12px 20px !important;
    width: 100% !important;
    cursor: pointer !important;
    box-shadow: 0 4px 14px rgba( 124, 58, 237, 0.35 ) !important;
    text-shadow: none !important;
    transition: opacity 0.2s !important;
    height: auto !important;
}
.login #wp-submit:hover { opacity: 0.9 !important; }

/* ── Rememberme ──────────────────────────────────────────── */
.login .forgetmenot { margin-bottom: 16px; }
.login .forgetmenot label {
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    color: #9ca3af !important;
}

/* ── Lien mot de passe oublié ────────────────────────────── */
.login #nav {
    margin-top: 10px;
    text-align: center;
}
.login #nav a {
    color: #a78bfa !important;
    font-size: 12px;
    text-decoration: none;
}
.login #nav a:hover { text-decoration: underline; }

/* ── Toggle "Accès administrateur" ──────────────────────── */
.cia-admin-toggle {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}
.cia-admin-toggle a {
    color: #d1d5db;
    font-size: 12px;
    text-decoration: none;
    letter-spacing: 0.04em;
    transition: color 0.2s;
}
.cia-admin-toggle a:hover,
.cia-admin-toggle a.cia-toggle-open {
    color: #a78bfa;
}

/* ── Backtoblog (caché, superflu) ────────────────────────── */
#backtoblog { display: none !important; }

/* ── Sélecteur de langue (caché) ─────────────────────────── */
.language-switcher { display: none !important; }

/* ── Erreurs / messages ──────────────────────────────────── */
.login #login_error,
.login .message,
.login .success {
    border-radius: 10px !important;
    border-left: none !important;
    border: 1px solid transparent !important;
    padding: 12px 16px !important;
    font-size: 13px !important;
    margin-bottom: 16px !important;
}
.login #login_error {
    background: #fef2f2 !important;
    border-color: #fecaca !important;
    color: #b91c1c !important;
}
.login .message {
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
    color: #1d4ed8 !important;
}

/* ── Bouton show/hide password ───────────────────────────── */
.login .wp-pwd .button {
    border-radius: 8px !important;
    border: 1px solid #e5e7eb !important;
    background: #fff !important;
    color: #9ca3af !important;
    box-shadow: none !important;
    padding: 4px 8px !important;
    height: auto !important;
    line-height: 1 !important;
}

/* ── Privacy policy link (masqué) ────────────────────────── */
.login .privacy-policy-page-link { display: none !important; }

/* ── Responsive ──────────────────────────────────────────── */
@media ( max-width: 480px ) {
    #login { padding: 32px 20px 28px !important; }
    .login h1 a { width: 140px; height: 70px; }
}

/* ── Label "INTRANET TRECOBAT" injecté par JS ────────────── */
#login-page-label {
    position: fixed;
    top: 28px;
    left: 50%;
    transform: translateX( -50% );
    color: rgba( 255, 255, 255, 0.35 );
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    white-space: nowrap;
    z-index: 10;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
