/* ---------- BASE ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ---------- CONTAINER ---------- */
.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 40px;
    max-width: 450px;
    width: 100%;
    animation: slideIn 0.5s ease;
}

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

/* ---------- HEADER ---------- */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    font-size: 48px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    gap: 0px;
    font-family: "Comic Sans MS", "Marker Felt", "Permanent Marker", cursive;
    user-select: none;
    margin-bottom: 15px;
}

.logo span {
    display: inline-block;
    transform: rotate(var(--rotate, 0deg));
    transition: transform 0.3s;
}

.logo span:hover {
    transform: rotate(calc(var(--rotate, 0deg) + 15deg)) scale(1.2);
    cursor: default;
}

.logo span:nth-child(1) { color: #ff4b5c; }
.logo span:nth-child(2) { color: #ffb400; }
.logo span:nth-child(3) { color: #6efff0; }
.logo span:nth-child(4) { color: #4dff6b; }
.logo span:nth-child(5) { color: #ffa1ff; }
.logo span:nth-child(6) { color: #ff6f91; }
.logo span:nth-child(7) { color: #7c83fd; }

.subtitle {
    color: #666;
    font-size: 14px;
}

/* ---------- TABS ---------- */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.tab {
    flex: 1;
    padding: 12px;
    background: #f0f0f0;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    color: #666;
}

.tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tab:hover:not(.active) {
    background: #e0e0e0;
}

/* ---------- FORMS ---------- */
.auth-form {
    display: block;
}

.auth-form.hidden {
    display: none;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input:focus {
    outline: none;
    border-color: #667eea;
}

/* ---------- PASSWORD STRENGTH ---------- */
.password-strength {
    margin-top: 8px;
    font-size: 12px;
    display: none;
}

.strength-bar {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin-top: 5px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s;
    border-radius: 2px;
}

.strength-weak { 
    background: #ff4757; 
    width: 33%; 
}

.strength-medium { 
    background: #ffa502; 
    width: 66%; 
}

.strength-strong { 
    background: #26de81; 
    width: 100%; 
}

/* ---------- PROFILE SELECTOR ---------- */
.profile-selector {
    margin-bottom: 20px;
}

.profile-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 15px;
    overflow: hidden;
    border: 3px solid #667eea;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
}

.profile-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.arrow-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #667eea;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #667eea;
    transition: all 0.3s;
}

.arrow-btn:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

.upload-btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.upload-btn:hover {
    background: #5568d3;
}

/* ---------- SUBMIT BUTTON ---------- */
.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ---------- ERROR MESSAGES ---------- */
.error-message {
    color: #ff4757;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
    .container {
        padding: 30px 20px;
    }
    
    .logo {
        font-size: 36px;
    }
    
    .profile-preview {
        width: 100px;
        height: 100px;
        font-size: 40px;
    }
}

/* ---------- RESPONSIVE MOBILE AMÉLIORÉ ---------- */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 25px 15px;
        width: 100%;
        max-width: 100%;
    }
    
    .logo {
        font-size: 32px;
        margin-bottom: 8px;
    }
    
    .subtitle {
        font-size: 13px;
    }
    
    /* Onglets */
    .tabs {
        margin-bottom: 20px;
    }
    
    .tab {
        padding: 10px 20px;
        font-size: 15px;
    }
    
    /* Forms */
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 13px;
    }
    
    .form-group input {
        font-size: 16px; /* Évite le zoom iOS */
        padding: 12px 14px;
    }
    
    /* Profile selector */
    .profile-preview {
        width: 90px;
        height: 90px;
        font-size: 36px;
    }
    
    .profile-controls {
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .arrow-btn {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .upload-btn {
        padding: 8px 15px;
        font-size: 13px;
    }
    
    /* Boutons */
    .submit-btn {
        padding: 12px;
        font-size: 15px;
    }
    
    /* Messages */
    .password-strength,
    .error-message {
        font-size: 11px;
    }
}

/* ---------- TRÈS PETIT ÉCRAN ---------- */
@media (max-width: 360px) {
    .logo {
        font-size: 28px;
    }
    
    .tab {
        padding: 8px 15px;
        font-size: 14px;
    }
    
    .profile-preview {
        width: 80px;
        height: 80px;
        font-size: 32px;
    }
}