/* ============================================
   CSS Pages de connexion IDeT
   Institut de Développement du Thérapeute
   Login + Mot de passe oublié
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #000091;
    --dark-blue: #000074;
    --text-primary: #1a1a1a;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --background: #f8f9fa;
    --surface: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

/* ============================================
   BASE
   ============================================ */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--background);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(0, 0, 145, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(0, 0, 145, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   CONTENEURS (login + oubli)
   ============================================ */

.login-container,
.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
}

.login-card,
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 48px 40px;
    border: 1px solid var(--border);
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   LOGO
   ============================================ */

.logo-section {
    text-align: center;
    margin-bottom: 32px;
}

.logo-circle {
    width: 80px;
    height: 80px;
    background: var(--primary-blue);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
    margin-bottom: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 145, 0.25);
    text-decoration: none;
    transition: opacity 0.2s;
}

.logo-circle:hover {
    opacity: 0.9;
}

.logo-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.logo-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ============================================
   TITRES (login + oubli)
   ============================================ */

.welcome-text,
.page-title {
    text-align: center;
    margin-bottom: 32px;
}

.welcome-text h1,
.page-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.welcome-text p,
.page-title p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ============================================
   ALERTES
   ============================================ */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Messages SPIP (page oubli) */
.reponse_formulaire_ok {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.reponse_formulaire_erreur {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

/* ============================================
   FORMULAIRES SPIP
   ============================================ */

/* Masquer les éléments SPIP indésirables */
.formulaire_spip fieldset {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.formulaire_spip legend {
    display: none !important;
}

/* Structure formulaire */
.formulaire_spip {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.formulaire_spip .editer-groupe {
    display: flex;
    flex-direction: column;
    gap: 20px;
    border: none !important;
    padding: 0 !important;
    background: none !important;
}

.formulaire_spip .editer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: none !important;
    padding: 0 !important;
    background: none !important;
}

.formulaire_spip label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.obligatoire {
    color: #dc2626;
}

/* ============================================
   INPUTS
   ============================================ */

/* Même largeur pour tous les inputs et boutons */
.formulaire_spip input[type="text"],
.formulaire_spip input[type="password"],
.formulaire_spip input[type="email"],
.formulaire_spip input[type="submit"],
.formulaire_spip button[type="submit"],
.formulaire_spip .btn-submit {
    width: 100% !important;
    box-sizing: border-box;
}

.formulaire_spip input[type="text"],
.formulaire_spip input[type="password"],
.formulaire_spip input[type="email"] {
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    background: var(--surface);
    color: var(--text-primary);
    font-family: inherit;
}

/* Désactiver l'œil natif Edge/IE qui se superpose */
.formulaire_spip input[type="password"]::-ms-reveal,
.formulaire_spip input[type="password"]::-ms-clear {
    display: none;
}

/* Wrapper pour le champ mot de passe avec icône */
.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper input {
    padding-right: 45px;
}

/* Bouton toggle password (œil) */
.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-blue);
    transition: all 0.2s;
}

.toggle-password:hover {
    opacity: 0.7;
}

.toggle-password:focus {
    outline: none;
}

.eye-icon {
    width: 20px;
    height: 20px;
    transition: opacity 0.2s;
}

.formulaire_spip input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(0, 0, 145, 0.08);
}

.formulaire_spip input::placeholder {
    color: #9ca3af;
}

.formulaire_spip input[type="checkbox"] {
    width: 16px !important;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-blue);
}

/* ============================================
   BOUTONS
   ============================================ */

.boutons {
    margin-top: 8px;
}

.formulaire_spip input[type="submit"],
.formulaire_spip button[type="submit"],
.formulaire_spip .btn-submit {
    padding: 14px 24px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 145, 0.25);
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.formulaire_spip input[type="submit"]:hover,
.formulaire_spip button[type="submit"]:hover,
.formulaire_spip .btn-submit:hover {
    background: var(--dark-blue);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 145, 0.35);
}

.formulaire_spip input[type="submit"]:active,
.formulaire_spip button[type="submit"]:active,
.formulaire_spip .btn-submit:active {
    transform: translateY(0);
}

/* Loader du bouton */
.btn-text,
.btn-loader {
    display: inline-flex;
    align-items: center;
}

.btn-loader {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================
   LIENS
   ============================================ */

.formulaire_spip a {
    font-size: 0.875rem;
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.formulaire_spip a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Lien mot de passe oublié */
.forgot-password {
    text-align: center;
    margin-top: 16px;
}

.forgot-password a {
    font-size: 0.875rem;
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.forgot-password a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Lien retour (page oubli) */
.back-link {
    text-align: center;
}

.back-link a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: color 0.2s;
}

.back-link a:hover {
    color: var(--primary-blue);
}

/* ============================================
   DIVIDER
   ============================================ */

.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.divider span {
    padding: 0 12px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ============================================
   LIEN RETOUR SITE PUBLIC
   ============================================ */

.public-link {
    text-align: center;
}

.public-link a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: color 0.2s;
}

.public-link a:hover {
    color: var(--primary-blue);
}

/* ============================================
   FOOTER
   ============================================ */

.footer-info {
    margin-top: 32px;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 480px) {
    .login-card,
    .card {
        padding: 32px 24px;
    }
    
    .welcome-text h1,
    .page-title h1 {
        font-size: 1.25rem;
    }
    
    .logo-circle {
        width: 70px;
        height: 70px;
        font-size: 1.25rem;
    }
}