/* ============================================
   MODALE DE CRÉATION DE COMPTE MODERNE
   ============================================ */

/* Container principal */
.modern-register-modal {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modern-register-modal .modern-account-form {
    background: transparent;
    padding: 0;
}

/* Header minimal avec logo uniquement */
.modern-register-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 2rem;
    margin-bottom: 1rem;
    position: relative;
}

.modern-register-header .header-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modern-register-header .header-logo img {
    height: 40px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
    transition: all 0.3s ease;
}

/* Formulaire moderne */
.modern-register-form {
    padding: 0.5rem 1rem;
}

.modern-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.375rem 1rem;
}

.modern-form-group {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0 0.25rem;
}

.modern-form-group.full-width {
    grid-column: 1 / -1;
    margin: 0;
}

/* Labels */
.modern-form-label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #fff;
    font-weight: 500;
    font-size: 0.7rem;
    margin-bottom: 0;
}

.modern-form-label i {
    color: #667eea;
    font-size: 0.75rem;
}

.required {
    color: #ef4444;
    margin-left: 0.2rem;
}

/* Inputs */
.modern-input-wrapper {
    position: relative;
}

.modern-form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.425rem 0.625rem;
    color: #fff;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.modern-form-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.modern-form-input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Password toggle */
.password-wrapper {
    position: relative;
}

.modern-password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.125rem;
    transition: all 0.3s ease;
}

.modern-password-toggle:hover {
    color: #667eea;
}

.password-wrapper .modern-form-input {
    padding-right: 2.25rem;
}

/* Checkbox moderne */
.modern-checkbox-group {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.checkbox-arrow-wrapper {
    position: relative;
    margin-top: 0.5rem;
}

/* Flèche indicatrice */
.arrow-indicator {
    position: absolute;
    top: -25px;
    left: 0;
    z-index: 10;
    animation: bounce-arrow 2s infinite;
}

.arrow-indicator i {
    font-size: 1.2rem;
    color: #667eea;
    filter: drop-shadow(0 2px 4px rgba(102, 126, 234, 0.3));
}

/* Animation de la flèche */
@keyframes bounce-arrow {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(5px);
    }
    60% {
        transform: translateY(3px);
    }
}

/* Quand la checkbox est cochée, la flèche disparaît */
.modern-checkbox-group input[type="checkbox"]:checked ~ .arrow-indicator,
.modern-checkbox-group input[type="checkbox"]:checked + .modern-checkbox-label ~ .arrow-indicator {
    display: none;
}

/* Alternative : quand la checkbox est cochée, la flèche disparaît */
.checkbox-arrow-wrapper.checked .arrow-indicator {
    display: none;
}

.modern-checkbox-group input[type="checkbox"] {
    display: none;
}

.modern-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.7rem;
    line-height: 1.3;
    margin: 0 0.25rem;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.checkbox-icon {
    width: 18px;
    height: 18px;
    min-width: 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
    margin-top: 0.5px;
    cursor: pointer;
}

.checkbox-icon i {
    color: transparent;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    pointer-events: none;
}

.modern-checkbox-group input[type="checkbox"]:checked + .modern-checkbox-label .checkbox-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.modern-checkbox-group input[type="checkbox"]:checked + .modern-checkbox-label .checkbox-icon i {
    color: white;
}

.modern-checkbox-label:hover .checkbox-icon {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.checkbox-text {
    flex: 1;
}

.policy-link {
    color: #667eea;
    text-decoration: none;
    transition: all 0.3s ease;
}

.policy-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Bouton d'inscription */
.modern-register-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 6px;
    padding: 0.5rem;
    color: #fff;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin: 0 0.25rem;
}

.modern-register-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.modern-register-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.modern-register-btn:hover::before {
    left: 100%;
}

.modern-register-btn:active {
    transform: translateY(0);
}

/* Bouton désactivé */
.modern-register-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    filter: grayscale(50%);
    pointer-events: none;
}

.modern-register-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.modern-register-btn:disabled::before {
    display: none;
}

.modern-register-btn i {
    font-size: 0.875rem;
}

/* Loader */
.btn-loader {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.modern-register-btn.loading .btn-loader {
    display: block;
}

.modern-register-btn.loading span,
.modern-register-btn.loading i {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Switch de compte */
.modern-account-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.425rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    flex-wrap: wrap;
    margin: 0 0.25rem;
}

.switch-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.65rem;
}

.switch-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.1875rem;
    transition: all 0.3s ease;
    font-size: 0.65rem;
}

.switch-link:hover {
    color: #764ba2;
    gap: 0.25rem;
}

.switch-link i {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.switch-link:hover i {
    transform: translateX(3px);
}

/* Bouton de fermeture moderne */
.modern-account-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.modern-account-close::before,
.modern-account-close::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 1px;
    background: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
}

.modern-account-close::before {
    transform: rotate(45deg);
}

.modern-account-close::after {
    transform: rotate(-45deg);
}

.modern-account-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modern-account-close:hover::before,
.modern-account-close:hover::after {
    background: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .modern-register-header {
        padding: 1rem 1.5rem;
        margin-bottom: 0.75rem;
    }
    
    .modern-register-header .header-logo img {
        height: 32px;
        max-width: 120px;
    }
    
    .modern-register-modal {
        width: 95%;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .modern-register-form {
        padding: 0.375rem 0.75rem;
    }
    
    .modern-form-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .modern-form-group {
        margin-bottom: 0.75rem;
    }
    
    .modern-form-input {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
    }
    
    .modern-form-label {
        font-size: 0.75rem;
        margin-bottom: 0.375rem;
    }
    
    .modern-register-btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .modern-register-header {
        padding: 0.75rem 1rem;
    }
    
    .modern-register-header .header-logo img {
        height: 28px;
        max-width: 100px;
    }
    
    .modern-register-form {
        padding: 0.25rem 0.5rem;
    }
    
    .modern-form-group {
        margin-bottom: 0.625rem;
    }
    
    .modern-form-input {
        padding: 0.5rem 0.75rem;
        font-size: 0.825rem;
    }
    
    .modern-form-label {
        font-size: 0.7rem;
        margin-bottom: 0.325rem;
    }
    
    .modern-form-label i {
        font-size: 0.65rem;
    }
    
    .switch-text {
        font-size: 0.6rem;
    }
    
    .switch-link {
        font-size: 0.6rem;
    }
    
    .modern-account-switch {
        padding: 0.3125rem 0.375rem;
        margin: 0 0.125rem;
    }
    
    .modern-form-group {
        gap: 0;
        margin: 0 0.125rem;
    }
    
    .modern-form-grid {
        gap: 0.1875rem 0.5rem;
    }
    
    .header-logo img {
        max-height: 20px;
    }
}

/* Messages d'erreur */
.error-message {
    display: block;
    margin-top: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 4px;
    color: #ef4444;
    font-size: 0.625rem;
    font-weight: 500;
    line-height: 1.3;
    animation: slideInError 0.3s ease-out;
}

/* Animation d'apparition des erreurs */
@keyframes slideInError {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Style des inputs en erreur */
.modern-form-input.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.modern-form-input.error:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

/* Style des inputs en succès */
.modern-form-input.success {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.modern-form-input.success:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* Icône d'erreur */
.error-message i {
    margin-right: 0.25rem;
    font-size: 0.625rem;
}

/* Conteneur d'erreurs global */
.error-container {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 6px;
    color: #ef4444;
    font-size: 0.7rem;
    font-weight: 500;
    text-align: center;
}

.error-container i {
    margin-right: 0.5rem;
    font-size: 0.875rem;
}

/* Message de succès */
.success-message {
    display: block;
    margin-top: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 4px;
    color: #10b981;
    font-size: 0.625rem;
    font-weight: 500;
    line-height: 1.3;
    animation: slideInSuccess 0.3s ease-out;
}

@keyframes slideInSuccess {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modern-register-modal.active {
    animation: slideInUp 0.4s ease-out;
}

/* États de validation */
.modern-form-input.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.modern-form-input.success {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

/* Message d'erreur */
.error-message {
    color: #ef4444;
    font-size: 0.65rem;
    margin-top: 0.125rem;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.error-message i {
    font-size: 0.75rem;
}
