/**
 * Styles pour AuthManager - Modal d'authentification
 */

/* ==================== MODAL ==================== */

.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.auth-modal.visible {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.auth-modal-content {
    position: relative;
    background: #1a1a2e;
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: authModalIn 0.3s ease;
}

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

.auth-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 24px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.auth-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.auth-modal-body {
    padding: 40px 30px 30px;
}

/* ==================== FORM ==================== */

.auth-form h2 {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 20px;
    text-align: center;
}

.auth-form p {
    color: #a0a0b0;
    font-size: 0.9rem;
    margin-bottom: 20px;
    text-align: center;
}

.auth-field {
    margin-bottom: 20px;
}

.auth-field label {
    display: block;
    color: #a0a0b0;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.auth-field input {
    width: 100%;
    padding: 12px 16px;
    background: #252540;
    border: 1px solid #333355;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-field input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.auth-field input::placeholder {
    color: #666;
}

.auth-field small {
    display: block;
    color: #666;
    font-size: 0.75rem;
    margin-top: 4px;
}

/* ==================== BUTTONS ==================== */

.auth-btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.auth-btn-primary {
    background: #3b82f6;
    color: #fff;
}

.auth-btn-primary:hover:not(:disabled) {
    background: #2563eb;
}

.auth-btn-secondary {
    background: #252540;
    color: #fff;
    border: 1px solid #333355;
}

.auth-btn-secondary:hover:not(:disabled) {
    background: #333355;
}

.auth-btn-danger {
    background: #dc2626;
    color: #fff;
}

.auth-btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}

.auth-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    text-align: center;
}

.auth-btn-loading {
    animation: spin 1s linear infinite;
}

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

/* ==================== MESSAGES ==================== */

.auth-message {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    text-align: center;
}

.auth-message-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.auth-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    text-align: center;
}

/* ==================== LINKS ==================== */

.auth-links {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #333355;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.auth-links a {
    color: #60a5fa;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.auth-links a:hover {
    color: #93c5fd;
    text-decoration: underline;
}

/* ==================== PROFILE ==================== */

.auth-profile-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
}

.auth-profile-avatar {
    width: 80px;
    height: 80px;
    background: #252540;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

.auth-profile-email {
    color: #fff;
    font-size: 1.1rem;
}

.auth-badge-premium {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.auth-profile-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ==================== SUCCESS/ERROR VIEWS ==================== */

.auth-success-icon,
.auth-error-icon,
.auth-loading-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 16px;
}

.auth-loading-icon {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.auth-success-message,
.auth-error-message {
    text-align: center;
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.auth-success-message {
    color: #4ade80;
}

.auth-error-message {
    color: #f87171;
}

/* ==================== SYNC BUTTON ==================== */

.sync-header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    color: #60a5fa;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.sync-header-btn:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
}

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

.sync-header-btn svg {
    flex-shrink: 0;
}

/* Animation de rotation pour le sync en cours */
.sync-header-btn.syncing svg {
    animation: syncSpin 1s linear infinite;
}

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

/* Statut de succès */
.sync-header-btn.success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

/* Statut d'erreur */
.sync-header-btn.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* Statut hors ligne */
.sync-header-btn.offline {
    background: rgba(107, 114, 128, 0.1);
    border-color: rgba(107, 114, 128, 0.3);
    color: #9ca3af;
}

/* Statut conflit */
.sync-header-btn.conflict {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

/* Badge de statut (point ou texte) */
.sync-status {
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 8px;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 480px) {
    .auth-modal-content {
        width: 95%;
        margin: 10px;
    }

    .auth-modal-body {
        padding: 30px 20px 20px;
    }

    .auth-form h2 {
        font-size: 1.3rem;
    }

    .sync-header-btn {
        padding: 6px 10px;
    }

    .sync-header-btn svg {
        width: 18px;
        height: 18px;
    }
}
