/**
 * Styles pour le shortcode de connexion TCFA
 * Design moderne et responsive
 */

/* Variables CSS */
:root {
    --tcfa-bg-color: #F8F9FA;
    --tcfa-white: #FFFFFF;
    --tcfa-primary: #28a745;
    --tcfa-primary-hover: #218838;
    --tcfa-text: #333333;
    --tcfa-text-light: #666666;
    --tcfa-border: #E1E5E9;
    --tcfa-border-focus: #007bff;
    --tcfa-error: #dc3545;
    --tcfa-success: #28a745;
    --tcfa-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --tcfa-shadow-hover: 0 6px 12px rgba(0, 0, 0, 0.15);
    --tcfa-radius: 12px;
    --tcfa-transition: all 0.3s ease;
}

/* Container principal */
.tcfa-login-container {
    min-height: 100vh;
    background-color: var(--tcfa-bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Wrapper du formulaire */
.tcfa-login-form-wrapper {
    background: var(--tcfa-white);
    border-radius: var(--tcfa-radius);
    box-shadow: var(--tcfa-shadow);
    padding: 40px;
    width: 100%;
    max-width: 500px;
    transition: var(--tcfa-transition);
}
.pmpro-login .breadcrumb-area {
    display: none !important
}

.tcfa-login-form-wrapper:hover {
    box-shadow: var(--tcfa-shadow-hover);
}

/* Header */
.tcfa-login-header {
    text-align: center;
    margin-bottom: 32px;
}

.tcfa-login-header h2 {
    color: var(--tcfa-text);
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.tcfa-login-header p {
    color: var(--tcfa-text-light);
    font-size: 16px;
    margin: 0;
    line-height: 1.5;
}

/* Formulaire */
.tcfa-login-form {
    margin-bottom: 24px;
}

/* Groupes de champs */
.tcfa-form-group {
    margin-bottom: 24px;
}

.tcfa-form-group label {
    display: block;
    color: var(--tcfa-text);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.4;
    display: flex;
}

/* Champs de saisie */
.tcfa-form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--tcfa-border);
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.5;
    color: var(--tcfa-text);
    background-color: var(--tcfa-white);
    transition: var(--tcfa-transition);
    box-sizing: border-box;
}

.tcfa-form-control:focus {
    outline: none;
    /* border-color: var(--tcfa-border-focus); */
    box-shadow: none;
}

.tcfa-form-control::placeholder {
    color: #999;
}

/* Champ mot de passe avec icône */
.tcfa-password-field {
    position: relative;
}

.tcfa-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--tcfa-text-light);
    transition: var(--tcfa-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tcfa-password-toggle:hover {
    color: var(--tcfa-text);
}

.tcfa-password-toggle svg {
    width: 20px;
    height: 20px;
}

/* Checkbox personnalisée */
.tcfa-checkbox-group {
    margin-bottom: 32px;
}

.tcfa-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--tcfa-text);
    font-weight: 400;
    margin: 0;
}

.tcfa-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 20px;
    width: 20px;
    margin: 0;
    padding: 0;
    z-index: 1;
}

.tcfa-checkmark {
    height: 20px;
    width: 20px;
    background-color: var(--tcfa-white);
    border: 2px solid var(--tcfa-border);
    border-radius: 4px;
    margin-right: 12px;
    position: relative;
    transition: var(--tcfa-transition);
    flex-shrink: 0;
}

.tcfa-checkbox:checked ~ .tcfa-checkmark {
    background-color: var(--tcfa-primary);
    border-color: var(--tcfa-primary);
}

.tcfa-checkbox:checked ~ .tcfa-checkmark:after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.tcfa-checkbox:focus ~ .tcfa-checkmark {
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

/* Bouton de connexion */
.tcfa-login-btn {
    width: 100%;
    background-color: #1363DF;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--tcfa-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
}

.tcfa-login-btn:hover {
    background-color: #12BB6A;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(18, 187, 106, 0.3);
}

.tcfa-login-btn.loading {
    background-color: #12BB6A;
    color: white;
}

.tcfa-login-btn:active {
    transform: translateY(0);
}

.tcfa-login-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Spinner de chargement */
.tcfa-spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(-10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Messages d'erreur et de succès */
.tcfa-error-message,
.tcfa-success-message {
    font-size: 14px;
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    display: none !important;
    animation: fadeIn 0.3s ease-in-out;
}

.tcfa-error-message {
    color: var(--tcfa-error);
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.tcfa-error-message .tcfa-link {
    /* color: #082A5E; */
    color: #dc3545;
    text-decoration: underline;
    font-weight: 500;
}

.tcfa-error-message .tcfa-link:hover {
    color: var(--tcfa-primary-hover);
}

.tcfa-error-message:not([style*="display: none"]),
.tcfa-error-message[style*="display: block"] {
    display: block !important;
}

.tcfa-success-message {
    color: var(--tcfa-success);
    background-color: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.tcfa-success-message:not([style*="display: none"]) {
    display: block !important;
}

.tcfa-form-messages {
    margin-top: 16px;
}

/* Footer avec liens */
.tcfa-login-footer {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--tcfa-border);
}

.tcfa-login-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.tcfa-link {
    color: #082A5E;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--tcfa-transition);
}

.tcfa-link:hover {
    color: var(--tcfa-primary-hover);
    text-decoration: underline;
}

.tcfa-link-separator {
    color: var(--tcfa-text-light);
    font-size: 14px;
}

/* Message utilisateur déjà connecté */
.tcfa-login-already-logged {
    text-align: center;
    padding: 40px 20px;
    background: var(--tcfa-white);
    border-radius: var(--tcfa-radius);
    box-shadow: var(--tcfa-shadow);
}

.tcfa-login-already-logged p {
    color: var(--tcfa-text);
    font-size: 16px;
    margin: 0 0 16px 0;
}

.tcfa-login-already-logged a {
    color: var(--tcfa-primary);
    text-decoration: none;
    font-weight: 500;
}

.tcfa-login-already-logged a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 480px) {
    .tcfa-login-container {
        padding: 16px;
    }
    
    .tcfa-login-form-wrapper {
        padding: 24px;
        margin: 0;
    }
    
    .tcfa-login-header h2 {
        font-size: 24px;
    }
    
    .tcfa-login-header p {
        font-size: 14px;
    }
    
    .tcfa-form-control {
        font-size: 16px; /* Évite le zoom sur iOS */
        padding: 12px 14px;
    }
    
    .tcfa-login-btn {
        padding: 12px 20px;
        font-size: 16px;
    }
    
    .tcfa-login-links {
        flex-direction: column;
        gap: 12px;
    }
    
    .tcfa-link-separator {
        display: none;
    }
}

@media (max-width: 360px) {
    .tcfa-login-form-wrapper {
        padding: 20px;
    }
    
    .tcfa-form-group {
        margin-bottom: 20px;
    }
}

/* Améliorations d'accessibilité */
.tcfa-form-control:focus,
.tcfa-password-toggle:focus,
.tcfa-checkbox:focus + .tcfa-checkmark,
.tcfa-login-btn:focus {
    outline: 2px solid var(--tcfa-border-focus);
    outline-offset: 2px;
}

/* Support du mode sombre (optionnel) */
@media (prefers-color-scheme: dark) {
    :root {
        --tcfa-bg-color: #1a1a1a;
        --tcfa-white: #2d2d2d;
        --tcfa-text: #ffffff;
        --tcfa-text-light: #cccccc;
        --tcfa-border: #404040;
    }
}

/* Animations d'entrée */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tcfa-login-form-wrapper {
    animation: fadeInUp 0.6s ease-out;
}

/* États de chargement */
.tcfa-login-btn.loading .tcfa-btn-text {
    display: none !important;
}

.tcfa-login-btn.loading .tcfa-btn-loading {
    display: inline-block !important;
}

/* Validation en temps réel */
.tcfa-form-control.error {
    border-color: var(--tcfa-error);
}

.tcfa-form-control.success {
    border-color: var(--tcfa-success);
}

/* Amélioration du contraste pour l'accessibilité */
.tcfa-form-control {
    color: var(--tcfa-text);
}

.tcfa-form-control::placeholder {
    color: #999;
    opacity: 1;
}

/* Support des navigateurs plus anciens */
.tcfa-login-container {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
}

/* Styles pour le formulaire de changement de mot de passe */
.tcfa-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.tcfa-password-wrapper .tcfa-form-control {
    padding-right: 48px;
}

.tcfa-toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--tcfa-text-light);
    transition: var(--tcfa-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.tcfa-toggle-password:hover {
    color: var(--tcfa-text);
}

.tcfa-toggle-password.active {
    color: var(--tcfa-primary);
}

.tcfa-toggle-password svg {
    width: 20px;
    height: 20px;
}

/* Indicateur de force du mot de passe */
.tcfa-password-strength {
    font-size: 13px;
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: 4px;
    background-color: #f8f9fa;
    display: none;
}

.tcfa-password-strength span {
    font-weight: 600;
}

.tcfa-password-strength .weak {
    color: #dc3545;
}

.tcfa-password-strength .medium {
    color: #ffc107;
}

.tcfa-password-strength .strong {
    color: #28a745;
}

.tcfa-password-strength .very-strong {
    color: #007bff;
}

/* Exigences du mot de passe */
.tcfa-password-requirements {
    margin-top: 6px;
}

.tcfa-password-requirements small {
    color: var(--tcfa-text-light);
    font-size: 13px;
    line-height: 1.4;
}

/* Séparateur dans les liens */
.tcfa-separator {
    color: var(--tcfa-text-light);
    font-size: 14px;
    margin: 0 4px;
}