/* Styles pour le plugin Compukaed Pro Auth */

/* Conteneur principal */
.compukaed-pro-auth-container {
    max-width: 500px;
    margin: 2rem auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Wrapper des formulaires */
.cpa-forms-wrapper {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
}

/* Container de formulaire */
.cpa-form-container {
    padding: 2.5rem;
    display: none;
    animation: slideInFade 0.3s ease-in-out;
}

.cpa-form-container.active {
    display: block;
}

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

/* Titres */
.cpa-form-container h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.cpa-form-container h2 i {
    color: #3498db;
    margin-right: 0.5rem;
}

.cpa-form-container h3 {
    color: #34495e;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #ecf0f1;
    display: flex;
    align-items: center;
}

.cpa-form-container h3 i {
    color: #3498db;
    margin-right: 0.5rem;
}

/* Sections de formulaire */
.cpa-form-section {
    margin-bottom: 2rem;
}

.cpa-form-section:last-child {
    margin-bottom: 1rem;
}

/* Groupes de champs */
.cpa-form-group {
    margin-bottom: 1.5rem;
}

.cpa-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 500;
    font-size: 0.95rem;
}

.cpa-form-group label i {
    color: #7f8c8d;
    margin-right: 0.5rem;
    width: 16px;
}

/* Champs de saisie */
.cpa-form-group input,
.cpa-form-group select,
.cpa-form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.cpa-form-group input:focus,
.cpa-form-group select:focus,
.cpa-form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.cpa-form-group input::placeholder {
    color: #bdc3c7;
}

/* Groupe input avec bouton */
.cpa-input-group {
    display: flex;
    gap: 0.5rem;
}

.cpa-input-group input {
    flex: 1;
}

.cpa-btn-verify {
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.cpa-btn-verify:hover {
    background: #2980b9;
}

.cpa-btn-verify:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

/* Status RUC */
.cpa-ruc-status {
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    display: none;
}

.cpa-ruc-status.success {
    background: #d5f4e6;
    color: #27ae60;
    border: 1px solid #27ae60;
    display: block;
}

.cpa-ruc-status.error {
    background: #fdf2f2;
    color: #e74c3c;
    border: 1px solid #e74c3c;
    display: block;
}

.cpa-ruc-status.loading {
    background: #e8f5fd;
    color: #3498db;
    border: 1px solid #3498db;
    display: block;
}

/* Force du mot de passe */
.cpa-password-strength {
    margin-top: 0.5rem;
    height: 4px;
    background: #ecf0f1;
    border-radius: 2px;
    overflow: hidden;
}

.cpa-password-strength::before {
    content: '';
    display: block;
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.cpa-password-strength.weak::before {
    width: 33%;
    background: #e74c3c;
}

.cpa-password-strength.good::before {
    width: 66%;
    background: #f39c12;
}

.cpa-password-strength.strong::before {
    width: 100%;
    background: #27ae60;
}

/* Checkbox personnalisé */
.cpa-checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.cpa-checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
    margin-top: 0.2rem;
}

.cpa-checkbox-group label {
    flex: 1;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Boutons */
.cpa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.cpa-btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.cpa-btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #1e6091);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3);
}

.cpa-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Liens de formulaire */
.cpa-form-links {
    text-align: center;
    margin-top: 1.5rem;
}

.cpa-form-links a {
    color: #3498db;
    text-decoration: none;
    font-size: 0.9rem;
}

.cpa-form-links a:hover {
    text-decoration: underline;
}

/* Toggle entre formulaires */
.cpa-toggle-forms {
    text-align: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #ecf0f1;
}

.cpa-toggle-forms p {
    margin: 0;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.cpa-toggle-forms a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
}

.cpa-toggle-forms a:hover {
    text-decoration: underline;
}

.cpa-toggle-register {
    display: block !important;
}

/* Campo de razón social en lecture seule */
.cpa-readonly-field {
    background-color: #f8f9fa !important;
    border: 2px solid #28a745 !important;
    color: #28a745 !important;
    font-weight: 600;
    cursor: not-allowed;
}

.cpa-readonly-field:focus {
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.25) !important;
}

.cpa-field-help {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #28a745;
}

.text-success {
    color: #28a745 !important;
}

/* Animation pour l'apparition du champ */
#razon-social-group {
    transition: all 0.3s ease-in-out;
    transform: translateY(-10px);
    opacity: 0;
}

#razon-social-group.show {
    display: block !important;
    transform: translateY(0);
    opacity: 1;
}

.cpa-register-form.active ~ .cpa-toggle-forms .cpa-toggle-login {
    display: none;
}

.cpa-register-form.active ~ .cpa-toggle-forms .cpa-toggle-register {
    display: block;
}

/* Alertes */
.cpa-alert {
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.cpa-alert-success {
    background: #d5f4e6;
    color: #1e7e34;
    border: 1px solid #27ae60;
}

.cpa-alert-error {
    background: #fdf2f2;
    color: #721c24;
    border: 1px solid #e74c3c;
}

.cpa-alert-info {
    background: #e8f5fd;
    color: #0c5460;
    border: 1px solid #3498db;
}

/* Messages d'erreur de champs */
.cpa-field-error {
    margin-top: 0.5rem;
    color: #e74c3c;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cpa-field-error::before {
    content: '⚠';
}

/* États de chargement */
.cpa-loading {
    opacity: 0.7;
    pointer-events: none;
}

.cpa-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    border: 3px solid #ecf0f1;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

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

/* Responsive */
@media (max-width: 768px) {
    .compukaed-pro-auth-container {
        margin: 1rem;
        max-width: none;
    }
    
    .cpa-form-container {
        padding: 1.5rem;
    }
    
    .cpa-input-group {
        flex-direction: column;
    }
    
    .cpa-btn-verify {
        width: 100%;
    }
}

/* Dashboard styles (aperçu) */
.cpa-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.cpa-dashboard-header {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.cpa-dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.cpa-stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.cpa-stat-card h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.cpa-stat-card .cpa-stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #3498db;
}
