/**
 * RDConnect - Formulaires Unifiés (Connexion, Inscription, Contact)
 * Date: 26 janvier 2026
 * 
 * Uniformise les cartes de formulaires sur les pages d'authentification
 * et de contact pour une cohérence visuelle parfaite
 */

/* ============================================
   1. CARTES DE FORMULAIRES - TAILLE UNIFORME
   ============================================ */

/* Carte principale des formulaires auth */
.col-lg-5 > .card,
.col-lg-8 > .card,
.col-md-7 > .card,
.col-md-10 > .card {
    border-radius: 24px !important;
    box-shadow: 0 12px 50px rgba(0, 0, 0, 0.12) !important;
}

/* Login - Carte plus grande */
section.py-5 .col-lg-5 > .card .card-body {
    padding: 50px !important;
}

@media (max-width: 767.98px) {
    section.py-5 .col-lg-5 > .card .card-body {
        padding: 35px 25px !important;
    }
}

/* Register - Maintenir la taille cohérente */
section.py-5 .col-lg-8 > .card .card-body {
    padding: 50px !important;
}

@media (max-width: 991.98px) {
    section.py-5 .col-lg-8 > .card .card-body {
        padding: 40px 30px !important;
    }
}

@media (max-width: 575.98px) {
    section.py-5 .col-lg-8 > .card .card-body {
        padding: 30px 20px !important;
    }
}

/* ============================================
   2. FORMULAIRE CONTACT - CONTRASTE AMÉLIORÉ
   ============================================ */

/* Container du formulaire de contact */
.callback-form {
    background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 50%, #f8fafc 100%) !important;
    padding: 80px 0 !important;
}

/* Zone de formulaire avec fond blanc contrasté */
.callback-form .contact-form {
    background: #ffffff;
    border-radius: 24px;
    padding: 50px;
    box-shadow: 0 12px 50px rgba(8, 145, 178, 0.12);
    border: 1px solid rgba(8, 145, 178, 0.08);
}

/* Champs de formulaire contact - contraste élevé */
.callback-form .contact-form input.form-control,
.callback-form .contact-form textarea.form-control,
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="number"],
.contact-form textarea {
    background: #ffffff !important;
    border: 2px solid #d1d5db !important;
    border-radius: 12px !important;
    padding: 16px 20px !important;
    font-size: 15px !important;
    color: #1a1a2e !important;
    transition: all 0.3s ease !important;
    margin-bottom: 20px !important;
}

.callback-form .contact-form input.form-control::placeholder,
.callback-form .contact-form textarea.form-control::placeholder,
.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: #9ca3af !important;
}

.callback-form .contact-form input.form-control:focus,
.callback-form .contact-form textarea.form-control:focus,
.contact-form input:focus,
.contact-form textarea:focus {
    background: #ffffff !important;
    border-color: #0891b2 !important;
    box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.12) !important;
    outline: none !important;
}

/* Section titre contact */
.callback-form .section-heading h2 {
    color: #1a1a2e !important;
    font-size: 2rem;
    font-weight: 700;
}

.callback-form .section-heading span {
    color: #6b7280;
    font-size: 1.1rem;
}

/* Zone de sécurité/CAPTCHA avec contraste */
.security-verification-compact {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 16px !important;
    padding: 20px 25px !important;
    margin: 20px 0 !important;
}

@media (max-width: 767.98px) {
    .callback-form .contact-form {
        padding: 30px 20px;
        border-radius: 16px;
    }
    
    .callback-form {
        padding: 50px 0 !important;
    }
}

/* ============================================
   3. INPUT GROUPS - BORDURE UNIQUE & COINS ARRONDIS
   ============================================ */

/* 
 * IMPORTANT: Une seule bordure sur le conteneur, pas sur les éléments internes
 * Cela évite l'effet "double bordure" disgracieux
 */

/* Container input-group avec bordure unique */
.input-group {
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    border-radius: 12px !important;
    overflow: hidden;
    border: 1px solid #e2e8f0 !important;
    background: #f8fafc !important;
    transition: all 0.3s ease !important;
}

/* État focus - bordure cyan */
.input-group:focus-within {
    border-color: #0891b2 !important;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.15) !important;
    background: #ffffff !important;
}

/* SUPPRIMER toutes les bordures internes */
.input-group .input-group-text {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 14px 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.input-group .form-control {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 14px !important;
    height: auto !important;
}

.input-group .form-control:focus {
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Bouton toggle password */
.input-group .btn,
.input-group button#togglePassword,
.input-group button#togglePasswordConfirm {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 14px 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.input-group .btn:hover,
.input-group button#togglePassword:hover,
.input-group button#togglePasswordConfirm:hover {
    background: rgba(8, 145, 178, 0.1) !important;
}

.input-group .btn i,
.input-group button#togglePassword i,
.input-group button#togglePasswordConfirm i {
    font-size: 1.2rem;
    color: #6b7280;
    transition: color 0.2s ease;
}

.input-group .btn:hover i,
.input-group button#togglePassword:hover i,
.input-group button#togglePasswordConfirm:hover i {
    color: #0891b2 !important;
}

/* Select dans input-group */
.input-group .form-select {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 14px !important;
}

/* Champs sans input-group (standalone) */
input.form-control:not(.input-group .form-control),
select.form-select:not(.input-group .form-select),
textarea.form-control:not(.input-group .form-control) {
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    background: #f8fafc !important;
    padding: 14px 16px !important;
    transition: all 0.3s ease !important;
}

input.form-control:not(.input-group .form-control):focus,
select.form-select:not(.input-group .form-select):focus,
textarea.form-control:not(.input-group .form-control):focus {
    border-color: #0891b2 !important;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.15) !important;
    background: #ffffff !important;
}

/* ============================================
   4. COHÉRENCE VISUELLE GLOBALE
   ============================================ */

/* Labels uniformes */
section.py-5 .form-label,
.callback-form .form-label {
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

/* Boutons submit uniformes */
section.py-5 button[type="submit"],
.callback-form button[type="submit"] {
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%) !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 16px 32px !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    color: white !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(8, 145, 178, 0.25) !important;
}

section.py-5 button[type="submit"]:hover,
.callback-form button[type="submit"]:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(8, 145, 178, 0.35) !important;
}

/* Checkbox uniformes */
.form-check-input {
    width: 20px !important;
    height: 20px !important;
    border: 2px solid #d1d5db !important;
    border-radius: 4px !important;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: #0891b2 !important;
    border-color: #0891b2 !important;
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.2) !important;
}

/* ============================================
   5. HEADER DES FORMULAIRES
   ============================================ */

/* Icône circulaire header */
section.py-5 .card-body > .text-center .rounded-circle,
section.py-5 .text-center > .d-inline-flex.rounded-circle {
    width: 80px !important;
    height: 80px !important;
    background: linear-gradient(135deg, rgba(8, 145, 178, 0.12) 0%, rgba(6, 182, 212, 0.18) 100%) !important;
}

section.py-5 .card-body > .text-center .rounded-circle i,
section.py-5 .text-center > .d-inline-flex.rounded-circle i {
    font-size: 2rem !important;
    color: #0891b2 !important;
}

/* Titre du formulaire */
section.py-5 .card-body h2 {
    font-size: 1.75rem !important;
    font-weight: 700 !important;
    color: #1a1a2e !important;
}

/* Sous-titre */
section.py-5 .card-body > .text-center > p.text-muted {
    font-size: 1rem !important;
    color: #6b7280 !important;
}

/* ============================================
   6. MESSAGES D'ALERTE
   ============================================ */

.alert {
    border-radius: 12px !important;
    padding: 16px 20px !important;
    border: none !important;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1) !important;
    color: #059669 !important;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #dc2626 !important;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1) !important;
    color: #d97706 !important;
}

/* ============================================
   7. RESPONSIVE - TABLETTES ET MOBILES
   ============================================ */

@media (max-width: 991.98px) {
    /* Ajustements tablette */
    section.py-5 .col-lg-5,
    section.py-5 .col-lg-8 {
        max-width: 90%;
        margin: 0 auto;
    }
}

@media (max-width: 575.98px) {
    /* Ajustements mobile */
    section.py-5 {
        padding: 30px 0 !important;
    }
    
    section.py-5 .card {
        margin: 0 10px;
        border-radius: 16px !important;
    }
    
    /* Input group plus compact */
    .input-group .input-group-text {
        padding: 12px 14px !important;
    }
    
    .input-group .form-control {
        padding: 12px 45px 12px 12px !important;
    }
    
    .input-group button#togglePassword {
        padding: 0 12px !important;
    }
    
    /* Titre plus petit */
    section.py-5 .card-body h2 {
        font-size: 1.4rem !important;
    }
    
    /* Icône header plus petite */
    section.py-5 .card-body > .text-center .rounded-circle {
        width: 65px !important;
        height: 65px !important;
    }
    
    section.py-5 .card-body > .text-center .rounded-circle i {
        font-size: 1.6rem !important;
    }
}

/* ============================================
   8. USER TYPE CARDS (INSCRIPTION)
   ============================================ */

.user-type-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-type-card .card-inner {
    padding: 25px 20px;
    border-radius: 16px;
    border: 2px solid #e5e7eb;
    background: #ffffff;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

.user-type-card:hover .card-inner {
    border-color: #0891b2;
    background: rgba(8, 145, 178, 0.02);
}

.user-type-card.active .card-inner {
    border-color: #0891b2;
    background: rgba(8, 145, 178, 0.05);
    box-shadow: 0 4px 20px rgba(8, 145, 178, 0.15);
}

.user-type-card .type-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(8, 145, 178, 0.1) 0%, rgba(6, 182, 212, 0.15) 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.user-type-card .type-icon i {
    font-size: 1.5rem;
    color: #0891b2;
}

.user-type-card h5 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
}

.user-type-card .check-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.user-type-card .check-indicator i {
    font-size: 0.8rem;
    color: white;
    opacity: 0;
}

.user-type-card.active .check-indicator {
    background: #0891b2;
}

.user-type-card.active .check-indicator i {
    opacity: 1;
}

@media (max-width: 575.98px) {
    .user-type-card .card-inner {
        padding: 18px 15px;
    }
    
    .user-type-card .type-icon {
        width: 50px;
        height: 50px;
    }
    
    .user-type-card .type-icon i {
        font-size: 1.3rem;
    }
    
    .user-type-card h5 {
        font-size: 0.85rem;
    }
}
