/**
 * Styles pour le système de parrainage EfastWork
 * Section d'inscription avec code de parrainage
 */

/* Section principale de parrainage */
.referral-section {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border: 2px solid #e3f2fd;
    border-radius: 16px;
    padding: 20px;
    margin: 20px 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.referral-section::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #6e8efb, #a777e3, #ffd700);
    border-radius: 16px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.referral-section.active::before {
    opacity: 0.1;
}

.referral-section.active {
    background: linear-gradient(135deg, #fff 0%, #f8f9ff 100%);
    border-color: #6e8efb;
    box-shadow: 0 8px 32px rgba(110, 142, 251, 0.15);
    transform: translateY(-2px);
}

/* Bouton de toggle */
.referral-toggle {
    margin-bottom: 0;
}

.referral-toggle-btn {
    width: 100%;
    background: none;
    border: none;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 500;
    color: #495057;
}

.referral-toggle-btn:hover {
    background: rgba(110, 142, 251, 0.05);
    color: #6e8efb;
    transform: translateX(4px);
}

.referral-icon {
    font-size: 24px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-6px);
    }
    60% {
        transform: translateY(-3px);
    }
}

.referral-text {
    flex: 1;
    text-align: left;
}

.referral-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
    color: #6e8efb;
    font-weight: bold;
}

/* Contenu de la section */
.referral-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 0;
}

.referral-section.active .referral-content {
    max-height: 300px;
    opacity: 1;
    margin-top: 20px;
}

/* Label du champ */
.referral-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

.referral-label .optional {
    font-weight: 400;
    color: #6c757d;
    font-size: 13px;
}

/* Container du champ de saisie */
.referral-input-container {
    position: relative;
    margin-bottom: 16px;
}

/* Champ de saisie du code */
.referral-code-input {
    width: 100%;
    padding: 14px 50px 14px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.referral-code-input:focus {
    outline: none;
    border-color: #6e8efb;
    box-shadow: 0 0 0 3px rgba(110, 142, 251, 0.1);
    background: #fafbff;
}

.referral-code-input::placeholder {
    color: #adb5bd;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
}

/* Bouton de suppression */
.clear-referral-btn {
    position: absolute;
    right: 45px;
    top: 50%;
    transform: translateY(-50%);
    background: #dc3545;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
}

.clear-referral-btn:hover {
    background: #c82333;
    transform: translateY(-50%) scale(1.1);
}

/* Messages de validation */
.referral-status {
    margin-top: 12px;
    animation: slideDown 0.3s ease;
}

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

.validation-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    animation: fadeInScale 0.3s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.validation-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #c3e6cb;
}

.validation-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.validation-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #0d47a1;
    border: 1px solid #bbdefb;
}

.validation-loading {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border: 1px solid #ffeaa7;
}

.validation-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.validation-loading .validation-icon {
    animation: spin 1s linear infinite;
}

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

/* Informations du parrain */
.sponsor-info {
    margin-top: 16px;
    animation: slideDown 0.4s ease;
}

.sponsor-details {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #e8f5e8 0%, #d4edda 100%);
    border: 2px solid #c3e6cb;
    border-radius: 12px;
    padding: 16px;
    position: relative;
    overflow: hidden;
}

.sponsor-details::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #28a745, #20c997);
}

.sponsor-icon {
    font-size: 32px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.sponsor-content {
    flex: 1;
}

.sponsor-name {
    font-size: 16px;
    font-weight: 600;
    color: #155724;
    margin-bottom: 4px;
}

.sponsor-type {
    font-size: 13px;
    color: #28a745;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Texte d'aide */
.referral-help {
    margin-top: 12px;
    padding: 12px;
    background: rgba(110, 142, 251, 0.05);
    border-radius: 8px;
    border-left: 4px solid #6e8efb;
}

.referral-help small {
    color: #6c757d;
    line-height: 1.5;
    font-size: 13px;
}

/* Mode sombre */
.subform2023-dark-mode .referral-section {
    background: linear-gradient(135deg, #2d2d2d 0%, #3a3a3a 100%);
    border-color: #495057;
}

.subform2023-dark-mode .referral-section.active {
    background: linear-gradient(135deg, #343a40 0%, #2d2d2d 100%);
    border-color: #6e8efb;
}

.subform2023-dark-mode .referral-toggle-btn {
    color: #e9ecef;
}

.subform2023-dark-mode .referral-toggle-btn:hover {
    background: rgba(110, 142, 251, 0.15);
    color: #a777e3;
}

.subform2023-dark-mode .referral-code-input {
    background: #343a40;
    border-color: #495057;
    color: #e9ecef;
}

.subform2023-dark-mode .referral-code-input:focus {
    background: #2d2d2d;
    border-color: #6e8efb;
}

.subform2023-dark-mode .referral-label {
    color: #e9ecef;
}

.subform2023-dark-mode .referral-help {
    background: rgba(110, 142, 251, 0.1);
}

.subform2023-dark-mode .referral-help small {
    color: #adb5bd;
}

/* Responsive */
@media (max-width: 768px) {
    .referral-section {
        padding: 16px;
        margin: 16px 0;
    }
    
    .referral-toggle-btn {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .referral-icon {
        font-size: 20px;
    }
    
    .referral-code-input {
        padding: 12px 45px 12px 14px;
        font-size: 15px;
    }
    
    .sponsor-details {
        padding: 14px;
        gap: 12px;
    }
    
    .sponsor-icon {
        font-size: 28px;
    }
    
    .sponsor-name {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .referral-section {
        padding: 12px;
        border-radius: 12px;
    }
    
    .referral-toggle-btn {
        padding: 12px;
        font-size: 14px;
        gap: 10px;
    }
    
    .referral-code-input {
        padding: 10px 40px 10px 12px;
        font-size: 14px;
    }
    
    .clear-referral-btn {
        width: 20px;
        height: 20px;
        right: 35px;
        font-size: 12px;
    }
    
    .validation-message {
        padding: 10px 12px;
        font-size: 13px;
    }
}